On May 9, 12:49 am, Nick Taylor <nicktaylor1...@googlemail.com> wrote: > Hi all, > > I'm pretty new to Django so bare with me if this is a simple question. > > Basically, I have an Article model which is simply title, body, status > etc. Now, I want to add an additional TextBox to the admin for the > model, but I don't want to add it as part of the Article model, as I > don't want to store it directly into the database as a string. > > The TextBox will take an input, lets say "1, 2, 3, 4" I then want to > programmatically split this by the comma and add each item (1, 2, 3, > 4) as a separate record which is a pre-existing model. > > Any advice here would be greatly appreciated! > > Thanks a lot, > > Nick
You can use a custom form in the admin by simply saying form = MyFormClass in the ModelAdmin definition. In that custom form class, you can add your custom field in the declaration, then override the form save method to do the saving of the related objects. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.