def get_listing(self):
if not hasattr(self,'<STR_LIT>'):<EOL><INDENT>allEvents = self.get_allEvents()<EOL>openEvents = allEvents.filter(registrationOpen=True)<EOL>closedEvents = allEvents.filter(registrationOpen=False)<EOL>publicEvents = allEvents.instance_of(PublicEvent)<EOL>allSeries = allEvents.instance_of(Series)<EOL>self.listing = {<EOL>'<STR_LIT>': allEvents,<EOL>'<STR_LIT>': openEvents,<EOL>'<STR_LIT>': closedEvents,<EOL>'<STR_LIT>': publicEvents,<EOL>'<STR_LIT>': allSeries,<EOL>'<STR_LIT>': publicEvents.filter(registrationOpen=True).filter(<EOL>Q(publicevent__category__isnull=True) | Q(publicevent__category__separateOnRegistrationPage=False)<EOL>),<EOL>'<STR_LIT>': publicEvents.filter(registrationOpen=False).filter(<EOL>Q(publicevent__category__isnull=True) | Q(publicevent__category__separateOnRegistrationPage=False)<EOL>),<EOL>'<STR_LIT>': publicEvents.filter(<EOL>publicevent__category__separateOnRegistrationPage=True<EOL>).order_by('<STR_LIT>'),<EOL>'<STR_LIT>': allSeries.filter(registrationOpen=True).filter(<EOL>Q(series__category__isnull=True) | Q(series__category__separateOnRegistrationPage=False)<EOL>),<EOL>'<STR_LIT>': allSeries.filter(registrationOpen=False).filter(<EOL>Q(series__category__isnull=True) | Q(series__category__separateOnRegistrationPage=False)<EOL>),<EOL>'<STR_LIT>': allSeries.filter(<EOL>series__category__separateOnRegistrationPage=True<EOL>).order_by('<STR_LIT>'),<EOL>}<EOL><DEDENT>return self.listing<EOL>
This function gets all of the information that we need to either render or
validate the form.  It is structured to avoid duplicate DB queries