def _serialize_contribution(contrib): return { 'id': contrib.id, 'friendly_id': contrib.friendly_id, 'contributionId': contrib.id, 'title': contrib.title, 'location': contrib.venue_name, 'room': contrib.room_name, 'startDate': Conversion.datetime(contrib.start_dt), 'endDate': Conversion.datetime(contrib.end_dt), 'duration': Conversion.duration(contrib.duration), 'description': contrib.description, 'track': to_unicode(contrib.track.getTitle()) if contrib.track else None, 'session': contrib.session.title if contrib.session else None, 'type': contrib.type.name if contrib.type else None, 'address': contrib.address, 'reviewManager': fossilize(contrib.event_new.as_legacy.getReviewManager(contrib), IReviewManagerFossil) }
def getVars(self): vars = WJSBase.getVars( self ) if self._conf: vars["ConferenceId"] = self._conf.getId() vars["NumberOfContributions"] = self._conf.getNumberOfContributions() # these 2 vars are used to see if contrib dates shown should include day or just time vars["ConfStartDate"] = Conversion.datetime(self._conf.getAdjustedStartDate()) vars["IsMultiDayEvent"] = not isSameDay(self._conf.getStartDate(), self._conf.getEndDate(), self._conf.getTimezone()) location = "" if self._conf.getLocation() and self._conf.getLocation().getName(): location = self._conf.getLocation().getName().strip() vars["ConfLocation"] = location room = "" if self._conf.getRoom() and self._conf.getRoom().getName(): room = self._conf.getRoom().getName().strip() vars["ConfRoom"] = room else: # this is so that template can still be rendered in indexes page... # if necessary, we should refactor the Extra.js code so that it gets the # conference data from the booking, now that the booking has the conference inside vars["ConferenceId"] = "" vars["NumberOfContributions"] = 0 vars["ConfStartDate"] = "" vars["IsMultiDayEvent"] = False vars["ConfLocation"] = "" vars["ConfRoom"] = "" return vars
def _serialize_contribution(contrib): return { "id": contrib.id, "friendly_id": contrib.friendly_id, "contributionId": contrib.id, "title": contrib.title, "location": contrib.venue_name, "room": contrib.room_name, "startDate": Conversion.datetime(contrib.start_dt), "endDate": Conversion.datetime(contrib.end_dt), "duration": Conversion.duration(contrib.duration), "description": contrib.description, "track": contrib.track.title if contrib.track else None, "session": contrib.session.title if contrib.session else None, "type": contrib.type.name if contrib.type else None, "address": contrib.address, "reviewManager": fossilize(contrib.event_new.as_legacy.getReviewManager(contrib), IReviewManagerFossil), }