move helper properties onto orm.Spawner

since that's where they belong
This commit is contained in:
Min RK
2018-09-18 12:45:04 +02:00
parent 0fb78f19ec
commit a1dc73882a

View File

@@ -135,16 +135,6 @@ class User(Base):
id = Column(Integer, primary_key=True, autoincrement=True) id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(Unicode(255), unique=True) name = Column(Unicode(255), unique=True)
# properties on the spawner wrapper
# some APIs get these low-level objects
# when the spawner isn't running,
# for which these should all be False
active = running = ready = False
pending = None
@property
def orm_spawner(self):
return self
_orm_spawners = relationship( _orm_spawners = relationship(
"Spawner", "Spawner",
backref="user", backref="user",
@@ -219,6 +209,15 @@ class Spawner(Base):
started = Column(DateTime) started = Column(DateTime)
last_activity = Column(DateTime, nullable=True) last_activity = Column(DateTime, nullable=True)
# properties on the spawner wrapper
# some APIs get these low-level objects
# when the spawner isn't running,
# for which these should all be False
active = running = ready = False
pending = None
@property
def orm_spawner(self):
return self
class Service(Base): class Service(Base):
"""A service run with JupyterHub """A service run with JupyterHub