I've inlined a model so that when I add a new object of the parent model ( for the inlined model ) I can add child model instances in the same form, all done in admin.py. Standard stuff actually. But each child object has a sort_order-field with default value = 1. I'd like to have that default value reflect what order the inlined model is in the parents form. Say I add a new parent, in my form for adding a parent in the admin, I automatically get three inlined child items I can add if I want, each exposing a sort_order field with the value 1. I want those inlined models to get sort_order = 1, 2 and 3. If I click to add a new child item in that same form, it should be giving sort_order = 4, then 5 etc. You get the picture?
Is this possible? -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.