[residentadvisor] search by ticket status
This commit is contained in:
parent
1142868dd7
commit
3c1b69fdea
1 changed files with 10 additions and 6 deletions
|
|
@ -135,22 +135,26 @@ class ResidentadvisorModule(Module, CapCalendarEvent):
|
||||||
if not self.has_matching_categories(query):
|
if not self.has_matching_categories(query):
|
||||||
raise StopIteration()
|
raise StopIteration()
|
||||||
|
|
||||||
|
events = None
|
||||||
|
|
||||||
if query.city:
|
if query.city:
|
||||||
# FIXME
|
# FIXME
|
||||||
# we need the country to search the city_id in an efficient way
|
# we need the country to search the city_id in an efficient way
|
||||||
city_id = self.browser.get_city_id(query.city)
|
city_id = self.browser.get_city_id(query.city)
|
||||||
|
|
||||||
for event in self.browser.get_events(city = city_id):
|
events = self.browser.get_events(city = city_id)
|
||||||
yield event
|
|
||||||
elif query.summary:
|
elif query.summary:
|
||||||
for event in self.browser.search_events_by_summary(query.summary):
|
events = self.browser.search_events_by_summary(query.summary)
|
||||||
yield event
|
|
||||||
else:
|
else:
|
||||||
for event in self.list_events(query.start_date, query.end_date):
|
events = self.list_events(query.start_date, query.end_date)
|
||||||
|
|
||||||
|
for event in events:
|
||||||
|
event = self.fillobj(event, ['ticket'])
|
||||||
|
if event.ticket in query.ticket:
|
||||||
yield event
|
yield event
|
||||||
|
|
||||||
def fill_event(self, event, fields):
|
def fill_event(self, event, fields):
|
||||||
if set(fields) & set(('end_date', 'price', 'description')):
|
if set(fields) & set(('end_date', 'price', 'description', 'ticket')):
|
||||||
return self.get_event(event.id)
|
return self.get_event(event.id)
|
||||||
|
|
||||||
return event
|
return event
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue