>
> Hey,
>>
>
yeah, it basicly is. Just a very, very basic example (And sorry if i could 
highlight this as code, i didnt find something in the format-menu :/ ).
Of course you should validate your input first. And if you just want to 
edit a Model within a form, you should check on the ModelForm-Class 
https://docs.djangoproject.com/en/dev/topics/forms/modelforms/

def vote(request, poll_id):
    try:
        obj = YourModel.objects.get(pk=poll_id)
        obj.attributea = request.POST['attributea']
        obj.attributeb = request.POST['attributeb']
        obj.save()
        return HttpResponse(validparamshere)
    except ObjectDoesNotExist:
        return HttpResponse(show_some_error)


>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/uPRAe_zhfcgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to