Hi Petr,

On Jun 3, 5:48 pm, "petr.marhoun" <petr.marh...@gmail.com> wrote:
> I have some notes to forms-utils:
> - The code says: "if legend is None: legend = name". I dislike it - I
> want to have possibility not to set legend. I think that if legend is
> not set it should be "None" in fieldset.

Yes, this is one of the form-utils mistakes that I would want to
correct in the Django-core version :-) Note I didn't mention anything
about auto-setting legend in the proposal here.

> - It seems that it is not possible to say if form has fieldsets
> (fieldsets method even construct fieldsets if meta attribute is not
> set) - I think it is useful to know it in templates.

Yes, form.fieldsets should behave appropriately with __nonzero__ so
you can say {{ if form.fieldsets }}.

> Here I would prefer to be minimalistic. For example, widgets have
> "attrs", not "classes", so it is more consistent to use "attrs". And I
> have proposed "attrs" in another proposal because I think that there
> is general problem - how to customize parts of form rendering without
> writing of whole templates? So I would start with items "fields" and
> "legend", other items could be added later.

That's fine with me. I don't personally have a strong opinion about
"classes" vs "attrs."

> It is not so simple. Our proposals are that "fields" are list of field
> names. But in admin "fields" are list of items - and each item can be
> field name or list of field names. So I think that generally it is not
> possible to port admin's fieldsets to these proposals' fieldsets -
> proposals' fieldsets are subset of admin's fieldsets. (And syntax from
> admin seems to be too complex for Django core.)

I don't think it's simple, but I do think it's doable to build the
admin functionality on top of the core functionality as outlined
above, without duplicating code or bringing extra admin complexity
into core. It probably will require the admin code to have pretty
intimate knowledge of the core code, but that's nothing new :-)

Carl

-- 
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.

Reply via email to