Monday, December 31, 2012

Re: populate combobox inline

Hi, exists any way apply one formset in the admin.py for example

forms.py

number_fresh = Models.objects.all().count()

ProducFormset = formset_factory(ProductFresh, extra=number_fresh)
    MyFormSet = ProducFormset(initial=[{'name': u'product1','pub_date': datetime.date.today(),}])

admin.py

class FreschInline(admin.TabularInline):
    model = ProductFresch

    formset = MyFormSet     #apply here my formset but i have a error :( 

    extra = number_fresh


any idea ???

Cheers,


On Thu, Dec 27, 2012 at 9:52 PM, carlos <crocha09.09@gmail.com> wrote:
bad inglish version XD

hi i have a question
is there any way to populate a combobox inline with everyone from a list of products I use an extra parameter automatically to the amount of products but do not know how to fill them with the products look the picture please

spanish version
hola, yo necesito hacer el llenado del combobox automaticamente cuando se habra el form para introducir datos tiene alguna idea de como hacerlo, si ven la foto yo hago el conteo del numero de productos y se lo paso al parametro extra=unaCantidad pero no se como automaticamente
los combo esten cargado ese formulario es un inline

saludos


--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment