Exemplo n.º 1
0
def addVolunteer_woFamily(request):
     if request.method=='POST':
        form =AddNewVolunteersToFamily(data=request.POST)
        if form.is_valid():
            volunteer = form.save(commit=False)
            form.save()
            return HttpResponseRedirect(reverse('volunteerIndex'))
     else:
        form = AddNewVolunteersToFamily()
     return render_to_response('forms/addNewUserToFamily.html',{'form':form}, context_instance=RequestContext(request))
Exemplo n.º 2
0
def addContactToExistingFamily(request,famid):
     family = FamilyProfile.objects.get(pk= famid)
     if request.method=='POST':
            form =AddNewVolunteersToFamily(data=request.POST)
            if form.is_valid():
                volunteer = form.save(commit=False)
                form.save()
                family.famvolunteers.add(volunteer)
                return HttpResponseRedirect(reverse('familyprofile', kwargs={'famid': famid}))
     else:
        form = AddNewVolunteersToFamily()
     return render_to_response('forms/addNewUserToFamily.html',{'form':form}, context_instance=RequestContext(request))