def forwards(apps, schema_editor):
    """
    Create sample events.
    """
    starts = timeutils.round_datetime(
        when=timezone.now(),
        precision=timedelta(days=1),
        rounding=timeutils.ROUND_DOWN)
    ends = starts + appsettings.DEFAULT_ENDS_DELTA

    recurrence_rules = dict(
        RecurrenceRule.objects.values_list('description', 'recurrence_rule'))
    daily = recurrence_rules['Daily']
    weekdays = recurrence_rules['Daily, Weekdays']
    weekends = recurrence_rules['Daily, Weekends']
    weekly = recurrence_rules['Weekly']
    monthly = recurrence_rules['Monthly']
    yearly = recurrence_rules['Yearly']

    daily_event = G(
        EventBase,
        title='Daily Event',
        starts=starts + timedelta(hours=9),
        ends=ends + timedelta(hours=9),
        recurrence_rule=daily,
    )

    weekday_event = G(
        EventBase,
        title='Weekday Event',
        starts=starts + timedelta(hours=11),
        ends=ends + timedelta(hours=11),
        recurrence_rule=weekdays,
    )

    weekend_event = G(
        EventBase,
        title='Weekend Event',
        starts=starts + timedelta(hours=13),
        ends=ends + timedelta(hours=13),
        recurrence_rule=weekends,
    )

    weekly_event = G(
        EventBase,
        title='Weekly Event',
        starts=starts + timedelta(hours=15),
        ends=ends + timedelta(hours=15),
        recurrence_rule=weekly,
    )

    monthly_event = G(
        EventBase,
        title='Monthly Event',
        starts=starts + timedelta(hours=17),
        ends=ends + timedelta(hours=17),
        recurrence_rule=monthly,
    )

    yearly_event = G(
        EventBase,
        title='Yearly Event',
        starts=starts + timedelta(hours=19),
        ends=ends + timedelta(hours=19),
        recurrence_rule=yearly,
    )
def forwards ( apps , schema_editor ) : starts = timeutils . round_datetime ( when = timezone . now ( ) , precision = timedelta ( days = 1 ) , rounding = timeutils . ROUND_DOWN ) ends = starts + appsettings . DEFAULT_ENDS_DELTA recurrence_rules = dict ( RecurrenceRule . objects . values_list ( 'description' , 'recurrence_rule' ) ) daily = recurrence_rules [ 'Daily' ] weekdays = recurrence_rules [ 'Daily, Weekdays' ] weekends = recurrence_rules [ 'Daily, Weekends' ] weekly = recurrence_rules [ 'Weekly' ] monthly = recurrence_rules [ 'Monthly' ] yearly = recurrence_rules [ 'Yearly' ] daily_event = G ( EventBase , title = 'Daily Event' , starts = starts + timedelta ( hours = 9 ) , ends = ends + timedelta ( hours = 9 ) , recurrence_rule = daily , ) weekday_event = G ( EventBase , title = 'Weekday Event' , starts = starts + timedelta ( hours = 11 ) , ends = ends + timedelta ( hours = 11 ) , recurrence_rule = weekdays , ) weekend_event = G ( EventBase , title = 'Weekend Event' , starts = starts + timedelta ( hours = 13 ) , ends = ends + timedelta ( hours = 13 ) , recurrence_rule = weekends , ) weekly_event = G ( EventBase , title = 'Weekly Event' , starts = starts + timedelta ( hours = 15 ) , ends = ends + timedelta ( hours = 15 ) , recurrence_rule = weekly , ) monthly_event = G ( EventBase , title = 'Monthly Event' , starts = starts + timedelta ( hours = 17 ) , ends = ends + timedelta ( hours = 17 ) , recurrence_rule = monthly , ) yearly_event = G ( EventBase , title = 'Yearly Event' , starts = starts + timedelta ( hours = 19 ) , ends = ends + timedelta ( hours = 19 ) , recurrence_rule = yearly , )
Create sample events.