Hi Marcos , how are you? i would like to know about Generic  Inline formset 
factory, i tried to acces to your dpaste code but it has expired, can you 
please provide other link or shar your explanation or code by this same 
way? regards

El lunes, 8 de diciembre de 2008, 3:51:09 (UTC-4), Marco Louro escribió:
>
> Well, i've spent countless hours on this, and it was so easy.. I guess 
> it could be added to the docs since It's a really nice feature. 
>
> I've posted my very bad view code at dpaste, but it might be enough if 
> anyone who has a similar problem 
> http://dpaste.com/hold/96937/ 
>
>
>
> On Dec 8, 4:28 am, Marco Louro <mlo...@gmail.com> wrote: 
> > Thanks for quick reply Malcom. 
> > 
> > This is the code for my view. 
> > I know I'm missing something, the formsets do show up correctly on the 
> > form page, but I'm just not seeing how to load the request.POST data 
> > into the formset for validation and save 
> > 
> > The error I get is: 
> > Exception Value: 'Manager' object has no attribute 'empty' 
> > Exception Location:     /usr/lib/python2.5/site-packages/django/contrib/ 
> > contenttypes/generic.py in get_queryset, line 310 
> > 
> > def add(request,contact_type): 
> > 
> >     AddressFormSet = generic_inlineformset_factory(Address, extra=2) 
> > 
> >     if request.method == 'POST': 
> >         address_formset = AddressFormSet(request.POST,request.FILES) 
> >     else: 
> >         address_formset = AddressFormSet(instance=Person.objects.get 
> > (id=2)) 
> > 
> > I've also tried loading with 
> > address_formset = AddressFormSet(Person,BaseGenericInlineFormSet 
> > (request.POST,request.FILES)) 
> > 
> > Exception Value: 
> > 'NoneType' object has no attribute '_meta' 
> > Exception Location:     /usr/lib/python2.5/site-packages/django/contrib/ 
> > contenttypes/generic.py in __init__, line 295 
> > 
> > On Dec 8, 4:07 am, Malcolm Tredinnick <malc...@pointy-stick.com> 
> > wrote: 
> > 
> > > On Sun, 2008-12-07 at 19:46 -0800, Marco Louro wrote: 
> > > > Hi, 
> > 
> > > > I'm trying to use generic_inlineformset_factory. There are no docs 
> for 
> > > > it except a Generic Relations Model example @ 
> > > >http://www.djangoproject.com/documentation/models/generic_relations/ 
> > > > on the bottom (GenericInlineFormSet tests) 
> > 
> > > > My question here is how to pass the POST vars to it? 
> > 
> > > > In a modelformset_factory the following works: 
> > > >  formset = AddressFormSet(request.POST, request.FILES) 
> > 
> > > > but here it is not the case.. 
> > 
> > > Can you be specific about what is not working? If you look at the 
> source 
> > > for GenericInlineFormset, it certainly takes those parameters as the 
> > > first two arguments. So what are you actually doing and what error are 
> > > you seeing? (trim your example down the smallest possible code that 
> > > shows the problem so we don't have to wade through dozens of lines.) 
> > 
> > > Regards, 
> > > Malcolm

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e7c6084d-5f7d-4848-9c9d-4fd38ea9c387%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to