Wednesday, March 2, 2011

Regarding fieldsets in django

Hi All,
I am a django newbie and I have a pretty small question
here

I need to register a customized admin view, so I edited
<app name>/admin.py file and added the customized fieldsets, which is
working perfectly fine

However, I need to design a form with nested fieldsets
something like below:

general

field1
field2
field3

details
section1

field4
field5
field6

section2

field7
field8
field9


I tried the following fieldset in my admin.py:

fieldset1 = (
('general', {
'fields': ('f1', 'f2', 'f3', 'f4')
})
)

fieldset2 = (
(section1, {
'fields': ('f1', 'f2', 'f3', 'f4')
})
)

fieldset3 = (
(section2, {
'fields': ('f1', 'f2', 'f3', 'f4')
})
)

fieldsets = (fieldset1, fieldset2, fieldset3)


With the above design, I am getting something like below:

general

field1
field2
field3

section1
field1
field2
field3

section2
field1
field2
field3

However, this is not what I wanted

My question is how to design a nested fieldset using django?

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment