Sunday, April 15, 2012

How to change widgets for admin site?

Hello, I'm trying to create a blog site using Django (with "Post" as
my main model and "text" as the attribute corresponding to the main
body of text for each post). On the admin page, when someone is
filling out fields to create a new blog post, I want the "text" entry
field to be larger than the default field for a CharField attribute.

In this part of the docs:

https://docs.djangoproject.com/en/1.4/ref/contrib/admin/

in the "ModelAdmin options" section, under "ModelAdmin.fieldsets",
there is an image of pretty much what I want--a set of text entry
fields, where one of the fields, named "Content", is much larger than
the others to make it easier for whoever uses the admin site to type
in larger amounts of text. However, there isn't any clear explanation
that I can find in this section about how to achieve this.

The closest thing I can find is a little ways further, there's a
section that says you can use "classes" as a field_options dictionary
key, and it mentions two classes defined by the default admin style
sheet (collapse and wide). I think I need to specify some kind of
class in this way, but I don't know where on my file system the
default admin style sheet is located in order to read it and see if
there are any classes there I can use.

Can anyone help with this? Is there a built-in CSS class that does
what I want, or do I need to write it myself? If the latter, can
anyone tell me where I should write it and where I need to reference
it so that it affects the admin site?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate