On Tue, 2006-10-24 at 08:19 -0700, exdnc wrote: > Hi all, > > I'm trying to build a form that lets the user add any number of steps > to an existing activity. I've got an activity model and a related > steps model, with an activity having 0 or more steps. The > functionality I want is to have an "Add more steps" button on my > add/edit form, and to have this button add more steps. Eventually I'll > learn javascript and the 'add more' button will just add more fields to > the page. It looks to me like Django can easily edit existing related > objects, and can easily create num_in_admin related objects for a new > activity. However the framework doesn't seem to be able to create more > than num_in_admin related objects without some code to add the extra > fields to the manipulator and to add those extra fields to the > FormWrappers _inline_collections. > > Is there a 'proper' way to get the framework to add more than > num_in_admin related objects to both the Add/ChangeManipulator and to > the FormWrapper? Thanks!
The short answer to your question is "no": the num_in_admin setting controls the default number of form entry fields in that case. To solve your problem in a neat way, you might want to have a look in django/forms/__init__.py at the InlineObjectCollection class and try to exploit that in a custom manipulator. This isn't documented at all, so you'll have to read the source code and do a bit of experimenting, but it should be possible to get something that works. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---