Beispiel #1
0
def get_event_day_contributions(event_id, day_date):
    start_date = datetime.strptime(day_date, '%Y-%m-%d')
    end_date = start_date + timedelta(days=1)
    return list(
        db_contribution.get_contributions(start_date, end_date,
                                          [{
                                              'conferenceId': event_id
                                          }]))
Beispiel #2
0
def get_future_contributions():
    events = api.get_future_events()
    for event in events:
        if not db_event.get_event(event['id']):
            # store event
            event_tt = api.fetch_timetable(event['id'])
            db_event.store_event(event, event_tt)

    now = datetime.utcnow()
    tomorrow = now + timedelta(hours=6)
    results = list(db_contribution.get_contributions(now, tomorrow, [{'hasAnyProtection': False},
                                                                     {'_fossil': 'contribSchEntryDisplay'}])) \
            + list(db_event.get_ongoing_lectures(now, tomorrow))
    return sorted(results, key=lambda x: x['startDate'])
Beispiel #3
0
def get_ongoing_contributions():
    events = api.get_ongoing_events()
    for event in events:
        if not db_event.get_event(event['id']):
            # store event
            event_tt = api.fetch_timetable(event['id'])
            db_event.store_event(event, event_tt)

    now = datetime.utcnow()
    tomorrow = now + timedelta(hours=6)
    results = list(db_contribution.get_contributions(now, tomorrow, [{'hasAnyProtection': False},
                                                                             {'_fossil': 'contribSchEntryDisplay'}])) \
            + list(db_event.get_ongoing_lectures(now, tomorrow))
    return sorted(results, key=lambda x: x['startDate'])
Beispiel #4
0
def get_future_contributions():
    events = api.get_future_events()
    for event in events:
        if not db_event.get_event(event["id"]):
            # store event
            event_tt = api.fetch_timetable(event["id"])
            db_event.store_event(event, event_tt)

    now = datetime.utcnow()
    tomorrow = now + timedelta(hours=6)
    results = list(
        db_contribution.get_contributions(
            now, tomorrow, [{"hasAnyProtection": False}, {"_fossil": "contribSchEntryDisplay"}]
        )
    ) + list(db_event.get_ongoing_lectures(now, tomorrow))
    return sorted(results, key=lambda x: x["startDate"])
Beispiel #5
0
def get_ongoing_contributions():
    events = api.get_ongoing_events()
    for event in events:
        if not db_event.get_event(event['id']):
            # store event
            event_tt = api.fetch_timetable(event['id'])
            db_event.store_event(event, event_tt)

    now = datetime.utcnow()
    tomorrow = now + timedelta(hours=6)
    results = list(db_contribution.get_contributions(now, tomorrow, [{'hasAnyProtection': False},
                                                                             {'_fossil': 'contribSchEntryDisplay'}])) \
            + list(db_event.get_ongoing_lectures(now, tomorrow))

    if flask_session.get("indico_user", ""):
        for contrib in results:
            contrib["favorite"] = favorites.is_contribution_favorite(
                contrib, flask_session["indico_user"])
    return sorted(results, key=lambda x: x['startDate'])
Beispiel #6
0
def get_ongoing_contributions():
    events = api.get_ongoing_events()
    for event in events:
        if not db_event.get_event(event["id"]):
            # store event
            event_tt = api.fetch_timetable(event["id"])
            db_event.store_event(event, event_tt)

    now = datetime.utcnow()
    tomorrow = now + timedelta(hours=6)
    results = list(
        db_contribution.get_contributions(
            now, tomorrow, [{"hasAnyProtection": False}, {"_fossil": "contribSchEntryDisplay"}]
        )
    ) + list(db_event.get_ongoing_lectures(now, tomorrow))

    if flask_session.get("indico_user", ""):
        for contrib in results:
            contrib["favorite"] = favorites.is_contribution_favorite(contrib, flask_session["indico_user"])
    return sorted(results, key=lambda x: x["startDate"])
Beispiel #7
0
def get_event_day_contributions(event_id, day_date):
    start_date = datetime.strptime(day_date, "%Y-%m-%d")
    end_date = start_date + timedelta(days=1)
    return list(db_contribution.get_contributions(start_date, end_date, [{"conferenceId": event_id}]))