@property<EOL><INDENT>def organizer(self):<DEDENT>
rule = getConstant('<STR_LIT>')<EOL>org = {<EOL>'<STR_LIT:name>': _('<STR_LIT>'),<EOL>'<STR_LIT>': {'<STR_LIT:name>': _('<STR_LIT>'), '<STR_LIT>': _('<STR_LIT>')},<EOL>'<STR_LIT>': {'<STR_LIT:name>': '<STR_LIT>', '<STR_LIT>': '<STR_LIT>'},<EOL>'<STR_LIT:id>': None,<EOL>}<EOL>def updateForMonth(self, org):<EOL><INDENT>'''<STR_LIT>'''<EOL>if self.month:<EOL><INDENT>org.update({<EOL>'<STR_LIT:name>': _(month_name[self.month]),<EOL>'<STR_LIT>': {'<STR_LIT:name>': _(month_name[self.month]), '<STR_LIT>': self.month},<EOL>'<STR_LIT:id>': '<STR_LIT>' % self.month,<EOL>})<EOL><DEDENT>return org<EOL><DEDENT>def updateForSession(self, org):<EOL><INDENT>'''<STR_LIT>'''<EOL>if self.session:<EOL><INDENT>org.update({<EOL>'<STR_LIT:name>': self.session.name,<EOL>'<STR_LIT>': {'<STR_LIT:name>': _(self.session.name), '<STR_LIT>': _(self.session.name)},<EOL>'<STR_LIT:id>': self.session.pk,<EOL>})<EOL><DEDENT>return org<EOL><DEDENT>if rule in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>org = updateForSession(self, org)<EOL>if not org.get('<STR_LIT:id>'):<EOL><INDENT>org = updateForMonth(self, org)<EOL><DEDENT><DEDENT>elif rule == '<STR_LIT>':<EOL><INDENT>org = updateForMonth(self, org)<EOL><DEDENT>elif rule in ['<STR_LIT>','<STR_LIT>']:<EOL><INDENT>org = updateForSession(self, org)<EOL><DEDENT>elif rule in ['<STR_LIT>','<STR_LIT>']:<EOL><INDENT>if self.session and self.month:<EOL><INDENT>org.update({<EOL>'<STR_LIT:name>': _('<STR_LIT>' % (month_name[self.month], self.session.name)),<EOL>'<STR_LIT>': {'<STR_LIT:name>': _(month_name[self.month]), '<STR_LIT>': self.month},<EOL>'<STR_LIT>': {'<STR_LIT:name>': _(self.session.name), '<STR_LIT>': _(self.session.name)},<EOL>'<STR_LIT:id>': '<STR_LIT>' % (self.month, self.session.pk),<EOL>})<EOL><DEDENT>elif not self.month:<EOL><INDENT>org = updateForSession(self, org)<EOL><DEDENT>elif not self.session:<EOL><INDENT>org = updateForMonth(self, org)<EOL><DEDENT><DEDENT>elif rule == '<STR_LIT>':<EOL><INDENT>w = self.weekday<EOL>d = day_name[w]<EOL>if w is not None:<EOL><INDENT>org.update({<EOL>'<STR_LIT:name>': _(d),<EOL>'<STR_LIT>': {'<STR_LIT:name>': _(d), '<STR_LIT>': w},<EOL>'<STR_LIT:id>': w,<EOL>})<EOL><DEDENT><DEDENT>elif rule == '<STR_LIT>':<EOL><INDENT>w = self.weekday<EOL>d = day_name[w]<EOL>m = self.month<EOL>mn = month_name[m]<EOL>if w is not None and m:<EOL><INDENT>org.update({<EOL>'<STR_LIT:name>': _('<STR_LIT>' % (d, mn)),<EOL>'<STR_LIT>': {'<STR_LIT:name>': _(mn), '<STR_LIT>': m},<EOL>'<STR_LIT>': {'<STR_LIT:name>': _('<STR_LIT>' % d), '<STR_LIT>': w},<EOL>'<STR_LIT:id>': '<STR_LIT>' % (m, w)<EOL>})<EOL><DEDENT><DEDENT>return org<EOL>
Since events can be organized for registration in different ways (e.g. by month,
by session, or the interaction of the two), this property is used to make it easy
for templates to include necessary organizing information.  Note that this method
has nothing to do with the sorting of any queryset in use, which still has to be
handled elsewhere.