mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 06:22:59 +00:00
Edit spacing in orm.py
This commit is contained in:
@@ -294,7 +294,6 @@ class Proxy(Base):
|
|||||||
yield f
|
yield f
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Hub(Base):
|
class Hub(Base):
|
||||||
"""Bring it all together at the hub.
|
"""Bring it all together at the hub.
|
||||||
|
|
||||||
@@ -329,6 +328,7 @@ user_group_map = Table('user_group_map', Base.metadata,
|
|||||||
Column('group_id', ForeignKey('groups.id'), primary_key=True),
|
Column('group_id', ForeignKey('groups.id'), primary_key=True),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class Group(Base):
|
class Group(Base):
|
||||||
"""User Groups"""
|
"""User Groups"""
|
||||||
__tablename__ = 'groups'
|
__tablename__ = 'groups'
|
||||||
@@ -340,6 +340,7 @@ class Group(Base):
|
|||||||
return "<%s %s (%i users)>" % (
|
return "<%s %s (%i users)>" % (
|
||||||
self.__class__.__name__, self.name, len(self.users)
|
self.__class__.__name__, self.name, len(self.users)
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def find(cls, db, name):
|
def find(cls, db, name):
|
||||||
"""Find a group by name.
|
"""Find a group by name.
|
||||||
@@ -446,9 +447,9 @@ class UserServer(Base):
|
|||||||
server = relationship(Server, backref=backref('server_to_users', cascade='all, delete-orphan')
|
server = relationship(Server, backref=backref('server_to_users', cascade='all, delete-orphan')
|
||||||
)
|
)
|
||||||
|
|
||||||
__table_args__ = (
|
__table_args__ = (UniqueConstraint('_server_id'),
|
||||||
UniqueConstraint('_server_id'),
|
Index('server_user_index', '_server_id', '_user_id'),
|
||||||
Index('server_user_index', '_server_id', '_user_id'),)
|
)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<{cls}({name}@{ip}:{port})>".format(
|
return "<{cls}({name}@{ip}:{port})>".format(
|
||||||
|
Reference in New Issue
Block a user