#226 Fix SQLAlchemy warning
Merged 5 months ago by humaton. Opened a year ago by misc.

Fix SQLAlchemy warning
Michael Scherer • 5 months ago  
file modified
+2 -2
@@ -141,7 +141,7 @@ 

          ForeignKey('calendar_status.status', onupdate="cascade"),

          default='Enabled',

          nullable=False)

-     meetings = relationship("Meeting")

+     meetings = relationship("Meeting", back_populates="calendar")

  

      def __init__(

              self, calendar_name, calendar_contact, calendar_description,
@@ -336,7 +336,7 @@ 

          String(80),

          ForeignKey('calendars.calendar_name', onupdate="cascade"),

          nullable=False)

-     calendar = relationship("Calendar", lazy='joined')

+     calendar = relationship("Calendar", lazy='joined', back_populates="meetings")

      # 5 person max (32 * 5) + 5 = 165

      meeting_manager_user = relationship('MeetingsUsers', lazy='joined')

      meeting_date = Column(Date, default=safunc.now(), nullable=False)

Since Calendar and Meeting class reference each others, we have to be
explicit on the way the library must deal with conflicts. In this
case, the solution is to update the other object when there is a change.

It should partially fix #223

rebased onto 714e3c6

5 months ago

i am really surprised we didnt hit this issue.

i am really surprised we didnt hit this issue.

i am really surprised we didnt hit this issue.

Pull-Request has been merged by humaton

5 months ago
Metadata