Thanks for the reply, but that would force me to link each SubForm1
object with both a Form1 & Form2 object. I would like to link them
with either Form1 or Form2

Shai

On Dec 10, 5:22 pm, Superman <ramseydsi...@gmail.com> wrote:
> Can you not create another Field in SubForm 1 model? Like so:
>
> class SubForm1(models.Model):
>   def __unicode__(self):
>     return "SubForm1"
>
>   Form1 = models.ForeignKey(Form1)
>   Form2 = models.ForeignKey(Form2)
>   ## some fields here
>
> On Dec 10, 8:53 am, Shai <sha...@gmail.com> wrote:> Hi all,
>
> > I'm not sure my title is correct. Here Is my problem: I want to use
> > the django admin for data entry into some models. The models are based
> > on actual paper forms. There are several forms. and they share some
> > fields. I would like to follow the principle of DRY when creating this
> > app. As an illustration, consider the following models:
>
> > class Form1(models.Model):
> >   def __unicode__(self):
> >     return "Form1"
>
> > class Form2(models.Model):
> >   def __unicode__(self):
> >     return "Form2"
>
> >    ## some fields here
>
> > class SubForm1(models.Model):
> >   def __unicode__(self):
> >     return "SubForm1"
>
> >   Form = models.ForeignKey(Form1)
> >   ## some fields here
>
> > I would like to have Form2 also be linked to a SubForm1 model. How can
> > this be done?
>
> > Thanks,
> > Shai

--

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