Possible bug in admin?

13 views
Skip to first unread message

Julien Phalip

unread,
Mar 4, 2009, 9:46:36 PM3/4/09
to Django users
Hi,

I can't find the exact cause of this, but it seems as though something
has changed in the admin's email widget.

For one of my project I just upgraded Django from revision 9294 to
9975.

Symptomatically, with the recent version, the email field doesn't have
the CSS class 'vTextField', which means it looks smaller than the
other text fields in the form.

Do you know if that's by design or if that's an oversight?

For now, a quick fix is to do something like this in my code:

class MyModelAdmin(ModelAdmin):

def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.attname == 'email':
kwargs['widget'] = AdminTextInputWidget() # Have to do
that, otherwise the email field is bizarrely small (it doesn't have
the 'vTextField' class)...
return super(MyModelAdmin, self).formfield_for_dbfield
(db_field, **kwargs)

Thanks a lot,

Julien

Alex Gaynor

unread,
Mar 4, 2009, 10:16:16 PM3/4/09
to django...@googlegroups.com
It's a suckasding issue. There is a ticket with a patch open about it.

Alex

--
"I disapprove of what you say, but I will defend to the death your
right to say it." --Voltaire
"The people's good is the highest law."--Cicero

Julien Phalip

unread,
Mar 4, 2009, 10:33:27 PM3/4/09
to Django users
On Mar 5, 2:16 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On 3/4/09, Julien Phalip <jpha...@gmail.com> wrote:
> > Hi,
>
> > I can't find the exact cause of this, but it seems as though something
> > has changed in the admin's email widget.
>
> > For one of my project I just upgraded Django from revision 9294 to
> > 9975.
>
> > Symptomatically, with the recent version, the email field doesn't have
> > the CSS class 'vTextField', which means it looks smaller than the
> > other text fields in the form.
>
> > Do you know if that's by design or if that's an oversight?
>
> > For now, a quick fix is to do something like this in my code:
>
> > class MyModelAdmin(ModelAdmin):
>
> >     def formfield_for_dbfield(self, db_field, **kwargs):
> >         if db_field.attname == 'email':
> >             kwargs['widget'] = AdminTextInputWidget() # Have to do
> > that, otherwise the email field is bizarrely small (it doesn't have
> > the 'vTextField' class)...
> >         return super(MyModelAdmin, self).formfield_for_dbfield
> > (db_field, **kwargs)
>
> > Thanks a lot,
>
> > Julien
>
> It's a suckasding issue. There is a ticket with a patch open about it.
>
> Alex


Hi Alex,

I did search the ticket system and this list before posting but
couldn't find any reference to this issue. Would be great if you could
point me out to which ticket it is.

Thanks a lot,

Julien

Alex Gaynor

unread,
Mar 4, 2009, 10:40:07 PM3/4/09
to django...@googlegroups.com
Unfortunately I'm on a horrible setup right now but if you check for
tickets assigned to me(Alex) it should jump out.

Alex

Julien Phalip

unread,
Mar 4, 2009, 10:47:00 PM3/4/09
to Django users
On Mar 5, 2:40 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
Ok, thanks. I assume it's #10059.

Julien
Reply all
Reply to author
Forward
0 new messages