Hello again:

I'm going to explain how I solved the problem above finally:

My "solution" is to override the admin's change_form.html template
replacing the loops:

{% for fieldset in adminform %}
...
{% endfor %}

and

{% for inline_admin_formset in inline_admin_formsets %}
...
{% endfor %}

with custom html like this:

<fieldset class="module aligned {{ fieldset.classes }}">
        <h2>Vessel Identification</h2>
        <div class="form-row{% if adminform.form.current_name.errors %} errors
{% endif %} {{ adminform.form.current_name.name }}">
                {% if adminform.form.current_name.errors %}
{{ adminform.form.current_name.errors }}{% endif %}
                <div class="field-box">
                        {{ adminform.form.current_name.label_tag }}
{{adminform.form.current_name }}
                        {% if adminform.form.current_name.help_text %}<p 
class="help">
{{ adminform.form.current_name.help_text|safe }}</p>{% endif %}
                </div>
        </div>
        ..... and so on

To insert inlines between two form fields I made this dirty trick:

<div class="form-row">
        {% for inline_admin_formset in inline_admin_formsets %}
                {# DIY method to show only the wanted inline. #}
                {% ifequal inline_admin_formsets.0  inline_admin_formset %}
                        {% include inline_admin_formset.opts.template %}
                {% endifequal %}
        {% endfor %}
</div>

The problen here is to know the index of the inline you are interested
in. This way I can reuse Django's default inline templates. However in
somebody knows a better method I will be very grateful.

Greets.

--

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


Reply via email to