示例#1
0
def gigEdit(request, eventId=None):
    if eventId is None:
        item = Gig()
        item.programmer = Programmer.objects.get(user=request.user)
    else:
        item = get_object_or_404(Gig, id=eventId)
    return itemEdit(request, item, GigForm, GigAdminForm, 'editGig.html')
示例#2
0
def gigEdit(request, eventId=None):
    if eventId is None:
        item = Gig()
        item.programmer = Programmer.objects.get(user=request.user)
    else:
        item = get_object_or_404(Gig, id=eventId)
    return itemEdit(request, item, GigForm, GigAdminForm, 'editGig.html')
示例#3
0
def gig(request, id):
    if id == '0' and request.user.is_authenticated():
        event = Gig()
        event.programmer = Programmer.objects.get(user=request.user)
        event.startTime = time(19, 30)
        event.endTime = time(19, 30)
        try:
            year = int(request.GET['year'])
            month = int(request.GET['month'])
            if year in range(1970,2050) and month in range(1,13):
                event.startDate = date(year, month, 1)
            else:
                event.startDate = date.today()
        except:
            event.startDate = date.today()
        event.save()
    else:
        event = get_object_or_404(Gig, id=id)
        if not request.user.is_authenticated():
            if event.deleted or not event.confirmed:
                raise Http404
    return render_to_response('programming/gig.html',
                              {
                                  'maintitle': event.title,
                                  'extramessage': event.extramessage(request),
                                  'event': event,
                                  'fillerImage': Picture.objects.get(id=789),
                              },
                              context_instance=RequestContext(request)
    )