Esempio n. 1
0
 def post(self, request):
     form = ExhibitApplicationForm(request.POST, request.FILES)
     if not form.is_valid():
         return render(request, 'campus_field/exhibit/form.html', {
             'form': form,
             'post_url': reverse('exhibit:apply')
         })
     app = form.save(commit=False)
     app.organization = request.user.organization
     app.save()
     return HttpResponseRedirect(reverse('exhibit:manage'))
Esempio n. 2
0
 def post(self, request):
     form = ExhibitApplicationForm(request.POST,
                                   request.FILES)
     if not form.is_valid():
         return render(request, 'campus_field/exhibit/form.html', 
                       {'form': form,
                        'post_url': reverse('exhibit:apply')})
     app = form.save(commit=False)
     app.organization = request.user.organization
     app.save()
     return HttpResponseRedirect(reverse('exhibit:manage'))
Esempio n. 3
0
 def post(self, request):
     app_id = request.GET.get('id')
     app = get_object_or_404(ExhibitApplication, id=app_id)
     form = ExhibitApplicationForm(
             request.POST, request.FILES, instance=app)
     if not form.is_valid():
         return render(request, 'campus_field/exhibit/form.html', 
             {'form': form, 'app_id': app_id,
              'post_url': \
                  reverse('exhibit:modify')+'?id='+app_id})
     form.save()
     return HttpResponseRedirect(reverse('exhibit:manage'))
Esempio n. 4
0
 def post(self, request):
     app_id = request.GET.get('id')
     app = get_object_or_404(ExhibitApplication, id=app_id)
     form = ExhibitApplicationForm(request.POST,
                                   request.FILES,
                                   instance=app)
     if not form.is_valid():
         return render(request, 'campus_field/exhibit/form.html',
             {'form': form, 'app_id': app_id,
              'post_url': \
                  reverse('exhibit:modify')+'?id='+app_id})
     form.save()
     return HttpResponseRedirect(reverse('exhibit:manage'))
Esempio n. 5
0
 def get(self, request):
     app_id = request.GET.get('id')
     app = get_object_or_404(ExhibitApplication, id=app_id)
     form = ExhibitApplicationForm(instance=app)
     return render(request, 'campus_field/exhibit/form.html',
             {'form': form, 'app_id': app_id,
              'post_url': \
                  reverse('exhibit:modify')+'?id='+app_id})
Esempio n. 6
0
 def get(self, request):
     return render(request, 'campus_field/exhibit/form.html', {
         'form': ExhibitApplicationForm(),
         'post_url': reverse('exhibit:apply')
     })