Re: passing more information with formsets

2010-03-18 Thread hcarvalhoalves
On Mar 17, 9:34 pm, Alastair Campbell wrote: > On Wed, Mar 17, 2010 at 7:02 PM, Dennis Kaarsemaker > > wrote: > > In the view function, you could add an attribute (say, instance :-)) to > > each form in the formset. That to me is a better way than doing weird > > magic in a template. > > You're

Re: passing more information with formsets

2010-03-17 Thread Alastair Campbell
On Wed, Mar 17, 2010 at 7:02 PM, Dennis Kaarsemaker wrote: > In the view function, you could add an attribute (say, instance :-)) to > each form in the formset. That to me is a better way than doing weird > magic in a template. You're probably right, but I couldn't work that out for formsets: htt

Re: passing more information with formsets

2010-03-17 Thread Dennis Kaarsemaker
On wo, 2010-03-17 at 09:34 +, Alastair Campbell wrote: > On Tue, Mar 16, 2010 at 7:46 PM, Dennis Kaarsemaker wrote: > > Each ModelForm has an instance attribute, so you can use > > {{ form.instance.whatever }} > > Hi Dennis, > > Unfortunately it is not a model form. The form creates an "entry

Re: passing more information with formsets

2010-03-17 Thread Alastair Campbell
On Tue, Mar 16, 2010 at 7:46 PM, Dennis Kaarsemaker wrote: > Each ModelForm has an instance attribute, so you can use > {{ form.instance.whatever }} Hi Dennis, Unfortunately it is not a model form. The form creates an "entry", which is de-normalised data taken from the person (member) details and

Re: passing more information with formsets

2010-03-16 Thread Dennis Kaarsemaker
On ma, 2010-03-15 at 00:14 +, Alastair Campbell wrote: > Is there a way to loop through the members at the same time? Or some > other way of accessing the matching objects? Each ModelForm has an instance attribute, so you can use {{ form.instance.whatever }} -- Dennis K. The universe tends

passing more information with formsets

2010-03-14 Thread Alastair Campbell
Hi, I have a formset that is working well, but I'd like to use other information within that loop: {% for form in formset.forms %} [Member name would go here] {{ form }} {% endfor %} There is a queryset of member objects from the same view that matches the forms in the formse