mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 05:53:00 +00:00
add some re-usable APIs
define some pending/ready helpers as static constants on orm.Spawner allows treating orm.Spawner the same as Spawner wrappers, as long as `.active` etc. checks are performed first
This commit is contained in:
@@ -135,6 +135,16 @@ class User(Base):
|
||||
id = Column(Integer, primary_key=True, autoincrement=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(
|
||||
"Spawner",
|
||||
backref="user",
|
||||
|
Reference in New Issue
Block a user