Thanks for your reply Bruno.
On Fri, Feb 13, 2009 at 10:50, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

>
> On 13 fév, 09:24, Alan <alanwil...@gmail.com> wrote:
>
> <understatement>
> I really wonder how you could achieve this without javascript (unless
> of course you plan on reloading the whole page, but I doubt this is
> the case)
> </understatement>.
>

Indeed, I have been looking at
http://docs.djangoproject.com/en/dev/intro/tutorial02/#s-customize-the-admin-formand
used 'classes': ['collapse'] in my admin page to see how it works and
I
don't see any javascript there and I don't believe page is been reloaded.


>
> > but I was wondering if
> > there's something else hidden in forms.Form module that would help with
> that
> > because in the end what I would like is to keep collapsible just the form
> > entries that are not mandatory (required=False).
>

My question was more about how to pass some id to form in model.py, like, if
field is not required then get id=collapse when rendered in view, but I
think in
http://docs.djangoproject.com/en/dev/ref/forms/widgets/#ref-forms-widgets I
may have the answer.

Otherwise I guess I will have to write every field in my template rather
than using {{ form.as_p }}, got it? :-)

But that's OK, it will be a good exercise and I am on the way of trying it.

Thanks again for your attention.

Alan

-- 
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.
>>http://www.bio.cam.ac.uk/~awd28<<

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

Reply via email to