On Oct 11, 12:03 pm, Karen Tracey <[EMAIL PROTECTED]> wrote:
> At 06:00 PM 10/10/2007, Joseph Kocherhans wrote:
>
>
>
> > > >You're probably right. Something like radio_admin_fields on the
> > > >ModelAdmin class sounds reasonable. Could you file a ticket for this
> > > >so we don't lose track? I don't recall seeing one, but I could be
> > > >wrong.
>
> > > I couldn't find one either, so I opened one:
>
> > >http://code.djangoproject.com/ticket/5731
>
> > > I'll probably take a look at what's involved in doing it, but given
> > > my unfamiliarity with the code it's quite possible someone else could
> > > whip up a patch sooner.
>
> >Here's a hint that will hopefully help you (or anyone else really) get
> >started: this should probably happen in the formfield_for_dbfield
> >method of the ModelAdmin class.
>
> Upon further investigation I'm not sure a replacement for radio_admin
> is needed in newforms-admin. It seems the capability already exists,
> since the user can supply their own custom widgets by overriding
> formfield_for_dbfield. This thread shows it is already being done by
> some people:
>
> <http://groups.google.com/group/django-developers/browse_thread/thread...>http://groups.google.com/group/django-developers/browse_thread/thread...
>
> It may not be as easy, and it may not be possible for the user to get
> it to look quite exactly like it did in the old scheme, but the basic
> capability exists. So perhaps all that is needed is to remove the
> old radio_admin Field attribute?
>
> (Before I discovered this I did get it working by adding support for
> "radio_admin_fields" in a manner very similar to how "raw_id_fields"
> is done, and it's not a lot of code or anything too hairy. But
> coming to newforms-admin without the legacy of the old way, I think
> I'd wonder why there's this "radio_admin_fields" special case when
> the design supports a more general and flexible solution.)
>
> Thoughts?
>
I haven't dug to deeply into this, but from the sound of it, the
ModelAdmin class will need the radio_admin_fields because the look and
feel of the widget in the admin will differ from the generalized one
provided by newforms. This has been done with a few widgets and are
found in django.contrib.admin.widgets. In terms of what Joseph meant
by the formfield_callback is to hook the fields defined in
radio_admin_fields through the ModelAdmin formfield_callback method to
hook it into an admin specific widget that subclasses the newforms
provided one to get the same look and feel the oldforms admin gives.
> Karen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---