Le 23/05/2011 00:21, Carl Meyer a écrit :
Just had a quick conversation with Gregor and Chris Beaven on IRC;
based on a comment of Chris', we discussed the possibility of ditching
the {% formlayout %} tag in favor of specifying the layout as an
argument to the {% form %} block tag. E.g. instead of

     {% form %}
         {% formlayout "table" %}
         {% renderform my_form %} {# will use table layout #}
     {% endform %}
You'd say:

{% form "table" %}
     {% renderform my_form %}
{% endform %}

And perhaps if the layout can be specified that way, with minimal
boilerplate, we don't need the global-context-modifying version of
formlayout either.
From my experience, the most common use case would be to render one form using 
one layout.
So passing the layout at the toplevel form tag would be nice.

However, what could be interesting with the {% formlayout %} modifier is that 
you could use several layouts to render one form.
As an example:
::

  {% form %}
    {% formlayout "p" %}
    {% renderform form.field1 form.field2 %}

    {% formlayout "table" %}
    <table>
      {% renderform form.checkbox1 form.checkbox2 form.checkbox3 %}
    </table>
  {% endform %}

So I would say:
* add the layout as an argument of the toplevel {% form %} tag
* and keep {% formlayout %} as an option for specific use cases

I just realized that I adviced the opposite approach for hidden fields: not in 
the {% form %} tag, but in modifier.
That is because I think that hiding fields is not the most common use case, 
whereas using a specific layout is.

Benoît

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

Reply via email to