On Mar 15, 12:30 pm, "Tipan" <[EMAIL PROTECTED]> wrote:
> Realised my daft error in creating the dictionary. I've resolved that
> now and can happily pass the queryset data to the Form class by
> creating the dict. However, I'm still not sure how to pass the number
> of records to the Form class.

[ I responded earlier before catching up with your
latest post, but I think most of it still applies.]

>> number_of_meds = kwargs.pop('number_of_meds', 4)

This is how I optionally passed the number of
fields I wanted to display in the form.  If there's
no 'number_of_meds' in kwargs, a minimum of 4 fields
are displayed.  The trick is to use kwargs.pop() before
super is called, or you'll get an unexpected keyword
argument error.

It's possible that you may be able to determine the
number of fields from your passed data_dict and bypass
my kwargs.pop hack altogether.

--
Jeff Bauer
Rubicon, Inc.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to