Skip to content
Snippets Groups Projects
Commit ff52d53c authored by Martin Mareš's avatar Martin Mareš
Browse files

Upgrade: Odstraněny warningy o nebezpečných známostech v DB

parent 44ce3455
Branches
No related tags found
No related merge requests found
...@@ -102,8 +102,8 @@ class Place(Base): ...@@ -102,8 +102,8 @@ class Place(Base):
note = Column(Text, nullable=False, server_default=text("''::text")) note = Column(Text, nullable=False, server_default=text("''::text"))
hidden = Column(Boolean, server_default=text("false"), nullable=False) hidden = Column(Boolean, server_default=text("false"), nullable=False)
parent_place = relationship('Place', primaryjoin='Place.parent == Place.place_id', remote_side='Place.place_id') parent_place = relationship('Place', primaryjoin='Place.parent == Place.place_id', remote_side='Place.place_id', back_populates='children')
children = relationship('Place') children = relationship('Place', back_populates='parent_place')
school = relationship('School', uselist=False, back_populates='place') school = relationship('School', uselist=False, back_populates='place')
def type_name(self): def type_name(self):
...@@ -401,8 +401,8 @@ class User(Base): ...@@ -401,8 +401,8 @@ class User(Base):
note = Column(Text, nullable=False, server_default=text("''::text")) note = Column(Text, nullable=False, server_default=text("''::text"))
email_notify = Column(Boolean, nullable=False, server_default=text("true")) email_notify = Column(Boolean, nullable=False, server_default=text("true"))
roles = relationship('UserRole', primaryjoin='UserRole.user_id == User.user_id') roles = relationship('UserRole', primaryjoin='UserRole.user_id == User.user_id', back_populates='user')
participants = relationship('Participant', primaryjoin='Participant.user_id == User.user_id') participants = relationship('Participant', primaryjoin='Participant.user_id == User.user_id', back_populates='user')
def full_name(self) -> str: def full_name(self) -> str:
return self.first_name + ' ' + self.last_name return self.first_name + ' ' + self.last_name
...@@ -446,7 +446,7 @@ class Contest(Base): ...@@ -446,7 +446,7 @@ class Contest(Base):
master = relationship('Contest', primaryjoin='Contest.master_contest_id == Contest.contest_id', remote_side='Contest.contest_id', post_update=True) master = relationship('Contest', primaryjoin='Contest.master_contest_id == Contest.contest_id', remote_side='Contest.contest_id', post_update=True)
place = relationship('Place') place = relationship('Place')
round = relationship('Round') round = relationship('Round')
scoretable = relationship('ScoreTable', primaryjoin='Contest.scoretable_id == ScoreTable.scoretable_id') scoretable = relationship('ScoreTable', primaryjoin='Contest.scoretable_id == ScoreTable.scoretable_id', viewonly=True)
def is_subcontest(self) -> bool: def is_subcontest(self) -> bool:
return self.master_contest_id != self.contest_id return self.master_contest_id != self.contest_id
...@@ -523,7 +523,7 @@ class Participant(Base): ...@@ -523,7 +523,7 @@ class Participant(Base):
grade = Column(String(20), nullable=False) grade = Column(String(20), nullable=False)
registered_on = Column(DateTime(True)) registered_on = Column(DateTime(True))
user = relationship('User') user = relationship('User', back_populates='participants')
school_place = relationship('Place', primaryjoin='Participant.school == Place.place_id') school_place = relationship('Place', primaryjoin='Participant.school == Place.place_id')
...@@ -628,7 +628,7 @@ class UserRole(Base): ...@@ -628,7 +628,7 @@ class UserRole(Base):
assigned_by = Column(Integer, ForeignKey('users.user_id')) assigned_by = Column(Integer, ForeignKey('users.user_id'))
assigned_at = Column(DateTime(True), nullable=False, server_default=text("CURRENT_TIMESTAMP")) assigned_at = Column(DateTime(True), nullable=False, server_default=text("CURRENT_TIMESTAMP"))
user = relationship('User', primaryjoin='UserRole.user_id == User.user_id') user = relationship('User', primaryjoin='UserRole.user_id == User.user_id', back_populates='roles')
assigned_by_user = relationship('User', primaryjoin='UserRole.assigned_by == User.user_id') assigned_by_user = relationship('User', primaryjoin='UserRole.assigned_by == User.user_id')
place = relationship('Place') place = relationship('Place')
...@@ -940,7 +940,7 @@ class ScoreTable(Base): ...@@ -940,7 +940,7 @@ class ScoreTable(Base):
pdf_file = Column(String(255)) pdf_file = Column(String(255))
user = relationship('User') user = relationship('User')
contest = relationship('Contest', primaryjoin='Contest.scoretable_id == ScoreTable.scoretable_id') contest = relationship('Contest', primaryjoin='Contest.scoretable_id == ScoreTable.scoretable_id', viewonly=True)
class SentEmail(Base): class SentEmail(Base):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment