CSS question for the Admin

29 views
Skip to first unread message

Mike Dewhirst

unread,
Jun 2, 2016, 5:22:58 AM6/2/16
to Django users
I have a varchar field of 300+ chars and I'd like to know how to provide
space to wrap it on screen without resorting to a TextField

Any CSS ideas?

Thanks

Mike

Michal Petrucha

unread,
Jun 2, 2016, 5:32:34 AM6/2/16
to django...@googlegroups.com
Perhaps you could override the widget to a Textarea with the right
maxlength attribute? That should be fine if you don't target IE<10...

Cheers,

Michal
signature.asc

Mike Dewhirst

unread,
Jun 2, 2016, 6:18:00 AM6/2/16
to django...@googlegroups.com
I'm guessing I have to first inherit the admin form for the page
involved then tweak the widget.

Haven't played there before. Back to the docs ...

Thank you Michal

Cheers

Mike

>
> Cheers,
>
> Michal
>

Luis Zárate

unread,
Jun 2, 2016, 5:22:01 PM6/2/16
to django...@googlegroups.com
Include your own CSS en admin meta


class myAdmin(admin.ModelAdmin):

     class Meta:
           css ={'all': ['yourcss.css']}
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c15c5d17-075a-542c-31c3-35cc1f1d3120%40dewhirst.com.au.
> For more options, visit https://groups.google.com/d/optout.
>

--
"La utopía sirve para caminar" Fernando Birri



Reply all
Reply to author
Forward
0 new messages