diff options
-rw-r--r-- | f1elo/model.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/f1elo/model.py b/f1elo/model.py index 7757564..cb03109 100644 --- a/f1elo/model.py +++ b/f1elo/model.py @@ -16,9 +16,9 @@ class Driver(Base): rankings = relationship( 'Ranking', order_by='Ranking.rank_date', - back_populates='driver', - cascade="all", - passive_deletes=True) + back_populates='driver', + cascade="all", + passive_deletes=True) def __repr__(self): return (u"<%s (#%d)>" % (self.driver, self.id)).encode('utf8') @@ -72,17 +72,17 @@ class Entry(Base): ForeignKey( 'races.id', onupdate="CASCADE", - ondelete="CASCADE")) + ondelete="CASCADE")) race = relationship( 'Race', back_populates='entries', - order_by=result_group) + order_by=result_group) drivers = relationship( 'Driver', secondary=driver_entry, - cascade="all", - passive_deletes=True) + cascade="all", + passive_deletes=True) def __repr__(self): return ('#%s (%s) %s[%d]' % (self.car_no, ', '.join([driver.__repr__().decode('utf8') for driver in self.drivers]), self.result, self.result_group)).encode('utf8') @@ -101,18 +101,18 @@ class Race(Base): ForeignKey( 'race_types.id', onupdate="CASCADE", - ondelete="CASCADE")) + ondelete="CASCADE")) type = relationship( 'RaceType', back_populates='races', - order_by='Race.date') + order_by='Race.date') entries = relationship( 'Entry', back_populates='race', - order_by='Entry.result_group', - cascade="all", - passive_deletes=True) + order_by='Entry.result_group', + cascade="all", + passive_deletes=True) def __repr__(self): return ('%s (%s)' % (self.race, self.date)).encode('utf8') @@ -128,8 +128,8 @@ class RaceType(Base): races = relationship( 'Race', back_populates='type', - cascade="all", - passive_deletes=True) + cascade="all", + passive_deletes=True) def __repr__(self): return ('%s (%s)' % (self.description, self.code)).encode('utf8') @@ -147,7 +147,7 @@ class Ranking(Base): ForeignKey( 'drivers.id', onupdate="CASCADE", - ondelete="CASCADE")) + ondelete="CASCADE")) driver = relationship( 'Driver', back_populates='rankings', |