Пример #1
0
def festivalEdit(request, eventId=None):
    if eventId is None:
        item = Festival()
        item.programmer = Programmer.objects.get(user=request.user)
    else:
        item = get_object_or_404(Festival, id=eventId)
    return itemEdit(request, item, FestivalForm, FestivalAdminForm, 'editFestival.html')
Пример #2
0
def festivalEdit(request, eventId=None):
    if eventId is None:
        item = Festival()
        item.programmer = Programmer.objects.get(user=request.user)
    else:
        item = get_object_or_404(Festival, id=eventId)
    return itemEdit(request, item, FestivalForm, FestivalAdminForm,
                    'editFestival.html')
Пример #3
0
def festival(request, id):
    if id == '0' and request.user.is_authenticated():
        event = Festival()
        event.programmer = Programmer.objects.get(user=request.user)
        event.startDate = date.today()
        event.startTime = time(19, 30)
        event.endDate = date.today()
        event.endTime = time(19, 30)
    else:
        event = get_object_or_404(Festival, id=id)
        if not request.user.is_authenticated():
            if event.deleted or not event.confirmed:
                raise Http404
    prog = Prog(festival=event, public=True, approved=True)
    return render_to_response('programming/festival.html',
                              {
                                  'maintitle': event.title,
                                  'event': event,
                                  'extramessage': event.extramessage(request),
                                  'prog': prog.byDate(),
                                  'fillerImage': Picture.objects.get(id=789),
                              },
                              context_instance=RequestContext(request)
    )