Thanks for that tip.

I can guess what empty_permitted is, but could you explain how
empty_permitted is related to can_delete? I couldn't find it in the
docs, and such relationship is not apparent from the code.

Regards.

On Apr 15, 3:16 pm, Tom Evans <[email protected]> wrote:
> On Thu, Apr 15, 2010 at 6:45 AM, chefsmart <[email protected]> wrote:
> > Hi,
>
> > I have an inlineformset with a custom Modelform. So it looks something
> > like this:
>
> > MyInlineFormSet = inlineformset_factory(MyMainModel, MyInlineModel,
> > form=MyCustomInlineModelForm)
>
> > I am rendering this inlineformset manually in a template so that I
> > have more control over widgets and javascript. So I go in a loop like
> > {% for form in myformset.forms %} and then manually render each field
> > as described on this 
> > pagehttp://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-fo...
>
> > The formset has can_delete = True or can_delete = False depending on
> > whether the user is creating new objects or editing existing ones.
>
> > Question is, how do I manually render the can_delete checkbox?
>
> > Regards.
>
> {% if not form.empty_permitted %}{{ form.DELETE }}{% endif %}
>
> Cheers
>
> Tom

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

Reply via email to