Exemplo n.º 1
0
    def GET_happening_now(self):
        featured_event_fullnames = get_all_featured_events()

        featured_events = {}
        for target, event_id in featured_event_fullnames.iteritems():
            event = LiveUpdateEvent._by_fullname(event_id)
            featured_events[target] = event

        return AdminPage(content=pages.HappeningNowAdmin(featured_events),
                         title='live: happening now',
                         nav_menus=[]).render()
Exemplo n.º 2
0
def get_featured_event():
    """Return the currently featured live thread for the given user."""
    location = geoip.get_request_location(request, c)
    featured_events = get_all_featured_events()
    event_id = featured_events.get(location) or featured_events.get("ANY")

    if not event_id:
        return None

    try:
        return LiveUpdateEvent._by_fullname(event_id)
    except NotFound:
        return None
Exemplo n.º 3
0
 def thing_lookup(self, names):
     return LiveUpdateEvent._by_fullname(names, return_dict=False)