Monday, March 26, 2012

Re: How to adjust grid in Django Admin Forms

I tried changing width from 8em to 16em in /usr/local/lib/python2.7/
dist-packages/django/contrib/admin/static/admin/css/forms.css in the
two places where it appeared:

.aligned label{
display: bloack;
padding: 3px 10px 0 0;
float: left;
width: 8em;
}

and

.inline-group .aligned-label{
width: 8em;
}

but to no avail. Is there someplace else I should be looking??
On Mar 26, 10:21 am, akaariai <akaar...@gmail.com> wrote:
> On Mar 26, 4:53 pm, Steven <traveller3...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > I've just created a model in Django and want to use the admin form to
> > enter information for it. The problem I'm having is that my field
> > names are so long that they overlap the edit boxes where their values
> > are to be entered.
>
> > If one follows the tutorial in the Django website, it's as if the
> > label "Question:" overlapped the edit box where one was supposed to
> > enter a question.
>
> > The file "fieldset.html" in the /admin/includes sub-directory seems to
> > have the relevant code:
>
> > <fieldset class="module aligned {{ fieldset.classes }}">
> >     {% if fieldset.name %}<h2>{{ fieldset.name }} - Foo Test</h2>{%
> > endif %}
> >     {% for line in fieldset %}
> >         <div class="form-row{% for field in line %}{% if
> > field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor
> > %}">
> >               {% for field in line %}
> >                 <div>
> >                    {{ field.label_tag }}{{ field.field }}
> >                 </div>
> >             {% endfor %}
> >         </div>
> >     {% endfor %}
> > </fieldset>
>
> > What I can't figure out is how to allocate more space to
> > {{ field.label_tag }}, so that it is not covered up by
> > {{ field.label_tag }}.
>
> > Any help would be appreciated.
>
> Using firebug I spotted this css for the label tag (Django 1.2
> installation, might be different in more recent versions):
> .aligned label {
>     display: block;
>     float: left;
>     padding: 3px 10px 0 0;
>     width: 8em;
>
> }
>
> So, you would probably want to override that (the width, especially)
> in a custom css file. The documentation should contain the details of
> how to do that.https://docs.djangoproject.com/en/dev/ref/contrib/admin/
>
>  - Anssi

--
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