On Nov 20, 8:31 am, "Boris Schaeling" <[email protected]> wrote: > Is there a shortcut to create and update a model object from a form? For > example I'd like to write something like: > > MyModel.objects.create(mymodel_form.cleaned_data) > > or > > model_obj = get_object_or_404(MyModel, pk=id) > model_obj.update(mymodel_form.cleaned_data) > > Not setting attributes individually would also make it easier to change > models later without adding or removing attributes in the views. > > Boris
Use a ModelForm. -- DR. -- 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=.

