I would like to use generic view as much as possible. I have a small wrapper around 'create_update.update_object', basically to specify the 'template_name' and 'post_save_redirect'.
My 'Request' model has a number of fields, but I want to update only the fields that have to do with the rating of a request. The problem is, when I don't have all the fields in my template in the form variable {{ form.xxx }}, I can't get the update, or redirect to work. views.py: #(This is a wrapper around django.views.generic.create_update.update_object ) def raterequest_view(request, username, request_id): raterequest_dict = { 'model': Request, 'object_id': request_id, 'template_name' : 'request_rate_form.html', 'template_object_name' : 'raterequest', 'post_save_redirect': '/viewrequests/username', } return update_object(request, **raterequest_dict) request_rate_form.html:<!--Read relevant fields from db, update what is needed--> {% block content %} {% if raterequest %} <form action="" method="post"> <br>Reference: {{ raterequest.id }} <!--Don't want to update this field--> <br>Date: {{ raterequest.requestdate }} <!--Don't want to update this field--> <br>Request description: {{ raterequest.requestdescription }} <!-- Don't want to update this field--> <br>SLA: {{ form.sla }} <!--Want to update this field--> <br>Rating: {{ form.rating }} <!--Want to update this field--> <br><input type="submit" value="Rate request"/> </form> {% endif %} {% endblock %} --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. 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 -~----------~----~----~----~------~----~------~--~---