Re: Implement form.as_table, as_ul, as_p using templates

2017-02-03 Thread Josh Smeaton
I like the concept, though I haven't looked into the 4 points you laid out. I like the concept of the prefix you mentioned in the widget thread also - I'd love to see template packs as third party libraries that easily slot in (per form I think is crucial). I'm unsure of the proposed properties

Re: Implement form.as_table, as_ul, as_p using templates

2017-02-03 Thread Gert Steyn
Hi Tim The implementation can be extremely simple as most of the heavy lifting has already been done for widget templates. The only new parts are: 1. BaseForm.get_context 2. The templates to implement as_table, as_ul and as_p 3. A little bit of glue (render etc, pretty much the same as

Re: Implement form.as_table, as_ul, as_p using templates

2017-02-03 Thread Tim Graham
There's an old accepted ticket for it: https://code.djangoproject.com/ticket/16922. Reviewing the past discussion may help you refine your proposal. On Friday, February 3, 2017 at 6:01:11 AM UTC-5, Gert Steyn wrote: > > Hi All > > Is anybody against using the new renderers (used to render widget

Implement form.as_table, as_ul, as_p using templates

2017-02-03 Thread Gert Steyn
Hi All Is anybody against using the new renderers (used to render widgets) to also render the form? I suggest something like: class BaseForm(object): template_prefix = '' template_name = 'django/forms/form_as_table.html' def render(self, template_name=None): template_name =