I can't change the database design. Even if I could, that would still
mean I would have to define a model and a modelform for each table,
no?

On Oct 20, 6:13 pm, srb...@gmail.com wrote:
> Can you just break the table up into several tables connected with one-to-one 
> relations? Maybe look at the model forms you're using the most as a guide for 
> which fields to include in the new tables?
> Sent from my Verizon Wireless BlackBerry
>
> -----Original Message-----
> From: simonty <si...@auspayroll.com.au>
>
> Sender: django-users@googlegroups.com
> Date: Tue, 19 Oct 2010 23:16:38
> To: Django users<django-users@googlegroups.com>
> Reply-To: django-users@googlegroups.com
> Subject: DRY forms
>
> 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 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
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