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.