Look at modelforms with instance... http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ -- Emmanuel Mayssat
On Sun, Dec 26, 2010 at 8:48 PM, Burhan <burhan.kha...@gmail.com> wrote: > I forgot to add that this is the model that defines the relationship between > a merchant and a product: > class PriceList(models.Model): > product = models.ForeignKey(Product) > merchant = models.ForeignKey(Merchant) > minimum_price = models.FloatField(verbose_name=_(u'Minimum Price'), > help_text=_(u'This is the minimum > price that the merchant will accept for this product.\ > The default is 1.000. Replace this if > the merchant requires a higher minimum price for\ > this product.'), > default=1.000, > blank=False, > null=False) > name = models.CharField(max_length=100,verbose_name=_(u'Custom > Name'),blank=True,null=False, > help_text=_(u'This is a custom name for this > product and merchant. Use this field if\ > the merchant requests another name for the > same product, instead of adding new (duplicate) products.')) > I'm not sure how to tie in these models so I can get one form, with the > following fields, which the user can dynamically duplicate (to add more > items). > Product (select drop down, filtered from PriceList for a Merchant) > Pupil Name field > Pupil Relationship field (drop down, Son / Daughter) > Amount (from the LineItem model) > The validation is that the amount entered, should not be less than the > minimum amount specified in the PriceList model for the merchant+product > combination. The user can only select products from one merchant (ie, one > PriceList) at one time; to select from another merchant they have to start > the workflow again - by selecting a new merchant, from a different view. > Hope this helps clarify my problem. > > -- > 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. > -- 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.