Does your form look like:

    MyForm (ModelForm):
        Meta:
            fields: ['one', 'second']

it updates only those fields listed in meta tag. Other fields aren't
touched.

On Oct 20, 9:16 am, simonty <si...@auspayroll.com.au> wrote:
> Hello,
> I have a database table with about 100 fields.
> I have a number of forms with only a few  fields in each form based on
> the fields in the table.
> If I create one massive django model to represent the table and a
> number of modelforms based on
> the django model, this becomes inefficent because every time I update
> one of my small modelforms (
> which contain only a few fields), all fields in the table will get
> updated. I can see this when I inspect the
> sql query.
> Alternatively I can create small django models and base my modelforms
> on those but this isn't very DRY.
> Its a alot of work.
> Ideally, when I call save() on my modelform, I only want the fields on
> my form to be updated. This makes sense because I am saving the
> information in the form, not the entire model.
> Could anyone make any suggestions for the above scenario?
> Many thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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