List Info

Thread: InlineObjectCollection only has 3 FormFieldCollection




InlineObjectCollection only has 3 FormFieldCollection
user name
2006-09-19 21:33:16
Here's some interpreter session to give my upcoming
question a bit of context.

In [1]: from site.app.models import *

In [2]: manipulator = Container.AddManipulator()

In [3]: form = forms.FormWrapper(manipulator, {}, {})

In [4]: form['contained']
Out[4]: <django.forms.InlineObjectCollection object at
0xb76b4fcc>

In [5]: form['contained'].fill()

In [6]: form['contained']._collections
Out[6]:
{0: <FormFieldCollection: {'name': <FormFieldWrapper
for
"contained.0.name">, 'id':
<FormFieldWrapper for "contained.0.id">,
'amount': <FormFieldWrapper for
"contained.0.amount">, 'optional':
<FormFieldWrapper for
"contained.0.optional">, 'original': None,
'unit': <FormFieldWrapper for
"contained.0.unit">}>,
 1: <FormFieldCollection: {'name': <FormFieldWrapper
for
"contained.1.name">, 'id':
<FormFieldWrapper for "contained.1.id">,
'amount': <FormFieldWrapper for
"contained.1.amount">, 'optional':
<FormFieldWrapper for
"contained.1.optional">, 'original': None,
'unit': <FormFieldWrapper for
"contained.1.unit">}>,
 2: <FormFieldCollection: {'name': <FormFieldWrapper
for
"contained.2.name">, 'id':
<FormFieldWrapper for "contained.2.id">,
'amount': <FormFieldWrapper for
"contained.2.amount">, 'optional':
<FormFieldWrapper for
"contained.2.optional">, 'original': None,
'unit': <FormFieldWrapper for
"contained.2.unit">}>}

Does anyone know how to make an InlineObjectCollection have
more
inline objects when using AddManipulator and FormWrapper?
I'm only
getting three inline objects and I want to add more than
three
contained objects for every container object.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

InlineObjectCollection only has 3 FormFieldCollection
user name
2006-09-29 23:53:32
In your model, set the "num_in_admin" parameter on
your Foreign  Key as
follows:
product =  models.ForeignKey(Product,
edit_inline=models.TABULAR,
num_in_admin=5, num_extra_on_change=3)

With this, you'll get 5 objects in the Product form.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )