patrickk wrote:
> flatten_data() doesn´t relate to the custom manipulator but to model
> resp. the changemanipulator.
I see now... And if I'm guessing correctly you're creating a FormWrapper
from user_profile_manipulator that just doesn't have that checkbox field.
Anyway making two manipulators is unnecessary and I can't even imagine
how is this supposed to work :-).
Now, if I understand your task you want a form for your user profile but
with multiple checkboxes for 'music' field. Right? Then you can
inherit you manipulator from automatic UserProfile.ChangeManipulator and
replace this field with what you need:
class UserProfileManipulator(UserProfile.Manipulator):
def __init__(self, id):
UserProfile.Manipulator.__init__(self, id)
# Finding and removing standard field
for field in self.fields:
if field.field_name == 'music':
self.fields.remove(field)
break
# Adding custom field
MUSIC_CHOICES = [(str(c.id), str(c))
for c in Music.objects.all()]
self.fields.append(forms.CheckboxSelectMultipleField(
'music',
choices=MUSIC_CHOICES))
Does it make sense?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---