change it to this:

recipe = models.ForeignKey(Recipe,edit_inline=models.TABULAR
,num_in_admin=x,num_extra_on_change=y)

Replace X with how many you want to appear on object creation (when you
click add) and Y with how many you want to appear on edit.  You'll probably
want significantly more on add than on edit.

The documentation also lists more options
http://www.djangoproject.com/documentation/model_api/#many-to-one-relationships(scroll
down a bit to "
ForeignKey fields take a number of extra arguments..."   such as
max_num_in_admin
and min_num_in_admin.

Adam


On 12/27/06, Ben Collins-Sussman <[EMAIL PROTECTED]> wrote:


I've made a simple database for cooking recipes, whereby every Recipe
object contains a number of Ingredient objects.  In particular, within
my Ingredient model, I have the line

  recipe = models.ForeignKey(Recipe, edit_inline=models.TABULAR)

This is great, because the generated Admin interface "does the right
thing" automatically.  When I use the Admin interface to create a new
Recipe, I now gives me 3 tabular rows to add Ingredients.

My question is:  how can I make the Admin interface show more than 3
rows by default?  Most Recipes have many more than 3 ingredients.  :-)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to [email protected]
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