Hi,
I'd like to implement a simple "create" & "update" form for my
"Partner" model using ModelForm. How can I make the difference in a
view "save" function whether the POST comes from a "creation" or an
"update" form? Unfortunately the primary-key seems never to be
included by default in the form fields! This would have made it easy.
Got 3 view functions:
new(request):
<return empty unbound form>
edit(request, partner):
<return bound form from partner instance>
save(request):
<if id: # But there's no id
update partner
else:
create partner
Many thanks for any hint
Marc
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---