Created
October 28, 2010 16:53
-
-
Save fsouza/651782 to your computer and use it in GitHub Desktop.
edit.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def editar_pousada(request, id): | |
pousada = Pousada.objects.get(pk=id) | |
if request.method == 'POST': | |
form = PousadaForm(request.POST, instance = usuario) | |
if form.is_valid(): | |
form.save(request.user) | |
return HttpResponseRedirect(reverse('pousada.views.list_posts')) | |
else: | |
form = PousadaForm(instance = usuario) | |
return render_to_response('pousadas/editar.html', locals(), context_instance=RequestContext(request)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment