On Sun, Jul 11, 2010 at 12:16 PM, David Larlet <lar...@gmail.com> wrote: > Le 11 juil. 2010 à 17:36, Russell Keith-Magee a écrit : >> {% load custom_renderer %} >> {% form myform %} >> >> Django would ship with {% form %} implementations of the 'as_p' and >> 'as_ul' strategies, so getting 'as_p' rendering would mean: >> >> {% load xhtml_p_forms %} >> {% form myform %} > > Just a personal feedback, to me the rendering strategy is related to a whole > project and should be defined in settings, it's too easy to forget a loading > in a template. I know that you can use the django.template.add_to_builtins > function but it in this case it should be documented.
i'd say the other way around; it's not hard to imagine a single page with two or three forms rendered with different styles: a 'main' one rendered as_table(), and a footer field rendered as_p(). in that case, {%load%}'ing the style is too coarse granularity. i'd prefer an optional parameter to {%form%} to choose the renderer. something like: class myformrenderer (forms.as_table): name = 'left_table' ...... and in the template you could say {% form myform:"left_table" %} >> Doctypes >> -------- >> >> Once these two changes are in place, we use the form template tag >> specify the doctype that is passed to the widget render call. A >> 'html5_p_forms' library will pass 'html5' as the doctype when >> rendering fields, and get HTML5-compliant form fields; the >> 'xhml1_p_forms' library will pass 'xhtml1', and get XHMTL1-compliant >> form fields. > Again, why not directly in settings in order to be project's specific? Is > there anybody mixing doctypes on the same website? (backward compatibility > maybe?) here i fully agree, doctype should be project-specific. -- Javier -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@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.