Re: inline-model-formset help

2010-12-27 Thread Burhan
Thanks for that, I managed to get my form working the way I want. Now the only problem is I need to duplicate this form, well, actually, I need the user to be able to add multiple "items" in one view. Right now my form is "ModelForm", so to get multiple model forms in one view (and get the mana

Re: inline-model-formset help

2010-12-27 Thread Emmanuel Mayssat
I don't think you want a form set, but rather a modelform. Look at the top (not the bottom!) of the page http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ On Mon, Dec 27, 2010 at 12:06 AM, Burhan wrote: > Thanks, but I'm not sure which models to pass to it, when it asks for two > mode

Re: inline-model-formset help

2010-12-27 Thread Burhan
Thanks, but I'm not sure which models to pass to it, when it asks for two models in this: " If you want to create a formset that allows you to edit books belonging to a particular author, you could do this: >>> from django.forms.models import inlineformset_factory>>> BookFormSet = >>> inlinef

Re: inline-model-formset help

2010-12-26 Thread Emmanuel Mayssat
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 wrote: > I forgot to add that this is the model that defines the relationship between > a merchant and a product: > class PriceList(models

Re: inline-model-formset help

2010-12-26 Thread Burhan
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'),

inline-model-formset help

2010-12-26 Thread Burhan
I have a simple model: class LineItem(models.Model): customer = models.ForeignKey(Customer) merchant = models.ForeignKey(Merchant) product = models.ForeignKey(Product) child = models.ForeignKey(Pupil) amount = models.FloatField(blank=False,editable=False, default=1.000) In my