MultiValueField & MultiWidgets in Django Admin

136 views
Skip to first unread message

djangomg

unread,
Feb 10, 2010, 3:26:30 PM2/10/10
to Django users
Hi folks,

Having a heck of a time modifying the admin site to use
MultiValueField and MultiWidgets.

The concept

I am building a cms with page regions, I need to render a dynamic # of
textareas on the admin site and have them combine into a single
database field in the db.

I currently have a static # of fields working for displaying the
content on the admin, but the save method is never executed and no
errors are thrown.

Here is a pastebin with example snippets.
http://pastebin.com/f392604d6

Any help resolving this issue would be greatly appreciated. Also any
direction on how to pass in another field from the database model
'page_template' to the MultiWidget/MultiValueField to dynamically
render the fields () and widgets () tuples would be awesome!

Thanks ahead of time
Eric

bruno desthuilliers

unread,
Feb 11, 2010, 4:52:58 AM2/11/10
to Django users

On Feb 10, 9:26 pm, djangomg <e...@vianet.ca> wrote:
>
> I am building a cms with page regions, I need to render a dynamic # of
> textareas on the admin site and have them combine into a single
> database field in the db.

Wrong approach IMHO. If you have multiple page regions per page, each
needing it's own textarea, then you should have a PageRegion model
object, with a ForeignKey pointing to the page object.

My 2 cents.

Reply all
Reply to author
Forward
0 new messages