On Mar 26, 4:53 pm, Steven <[email protected]> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.