mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 05:53:00 +00:00
join some more relationships
This commit is contained in:
@@ -818,14 +818,14 @@ class OAuthCode(Expiring, Base):
|
|||||||
client_id = Column(
|
client_id = Column(
|
||||||
Unicode(255), ForeignKey('oauth_clients.identifier', ondelete='CASCADE')
|
Unicode(255), ForeignKey('oauth_clients.identifier', ondelete='CASCADE')
|
||||||
)
|
)
|
||||||
client = relationship("OAuthClient", back_populates="codes")
|
client = relationship("OAuthClient", back_populates="codes", lazy="joined")
|
||||||
code = Column(Unicode(36))
|
code = Column(Unicode(36))
|
||||||
expires_at = Column(Integer)
|
expires_at = Column(Integer)
|
||||||
redirect_uri = Column(Unicode(1023))
|
redirect_uri = Column(Unicode(1023))
|
||||||
session_id = Column(Unicode(255))
|
session_id = Column(Unicode(255))
|
||||||
# state = Column(Unicode(1023))
|
# state = Column(Unicode(1023))
|
||||||
user_id = Column(Integer, ForeignKey('users.id', ondelete='CASCADE'))
|
user_id = Column(Integer, ForeignKey('users.id', ondelete='CASCADE'))
|
||||||
user = relationship("User", back_populates="oauth_codes")
|
user = relationship("User", back_populates="oauth_codes", lazy="joined")
|
||||||
|
|
||||||
scopes = Column(JSONList, default=[])
|
scopes = Column(JSONList, default=[])
|
||||||
|
|
||||||
@@ -860,8 +860,12 @@ class OAuthClient(Base):
|
|||||||
def client_id(self):
|
def client_id(self):
|
||||||
return self.identifier
|
return self.identifier
|
||||||
|
|
||||||
spawner = relationship("Spawner", back_populates="oauth_client", uselist=False)
|
spawner = relationship(
|
||||||
service = relationship("Service", back_populates="oauth_client", uselist=False)
|
"Spawner", back_populates="oauth_client", uselist=False, lazy="joined"
|
||||||
|
)
|
||||||
|
service = relationship(
|
||||||
|
"Service", back_populates="oauth_client", uselist=False, lazy="joined"
|
||||||
|
)
|
||||||
access_tokens = relationship(
|
access_tokens = relationship(
|
||||||
APIToken, back_populates='oauth_client', cascade='all, delete-orphan'
|
APIToken, back_populates='oauth_client', cascade='all, delete-orphan'
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user