On Wed, Nov 19, 2008 at 10:23 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
>
>
> On 20 nov, 06:01, "Brian Rosner" <[EMAIL PROTECTED]> wrote:
>> On Wed, Nov 19, 2008 at 9:53 PM, [EMAIL PROTECTED]
>>
>> <[EMAIL PROTECTED]> wrote:
>>
>> > I use a fake queryset because it's the only way that I found to
>> > populate the formset (using a real queryset would lead to the same
>> > problem anyway), hence I wonder if there is a cleaner way to do what I
>> > want without reinventing modelforms, or using separate form classes
>> > for saving and creating my dynamic formsets.
>>
>> I think from what I gather you are looking to create an "add"-only
>> model formset? If so take a look 
>> athttp://code.djangoproject.com/ticket/9538. I have written some
>> information on that ticket that may be of use to you.
>>
>
> Yes I tried the approach you're talking about in the ticket:
>
> FormSet = modelformset_factory(SomeModel, extra=3)
>
> This creates 3 blank forms with INITIAL_FORMS=0, which is fine. But
> then how can I populate this formset with some initial data instead of
> the model's default values ?

Can you file a ticket about this? The fundamental issue here is that
formsets use initial data to populate the forms, but model formsets
make no distinction between initial data being passed in and initial
data it makes via the queryset. It sounds worth fixing.

-- 
Brian Rosner
http://oebfare.com

--~--~---------~--~----~------------~-------~--~----~
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