Re: ManyToManyField not populated in form

2006-08-30 Thread Ivan Sagalaev
Kenneth Gonsalves wrote: > i always use it, but for some reason it is not in the official docs - > although it is in the wiki Yes this is it: http://code.djangoproject.com/wiki/NewAdminChanges There is also a small point that is easy to miss: on POST one should call do_html2python both when

Re: ManyToManyField not populated in form

2006-08-30 Thread Kenneth Gonsalves
On 30-Aug-06, at 2:33 PM, cyberco wrote: > So should I always use 'manipulator.flatten_data()' instead of > 'obj.__dict__' for filling forms with existing values? i always use it, but for some reason it is not in the official docs - although it is in the wiki -- regards kg

Re: ManyToManyField not populated in form

2006-08-30 Thread cyberco
That works, great! So should I always use 'manipulator.flatten_data()' instead of 'obj.__dict__' for filling forms with existing values? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: ManyToManyField not populated in form

2006-08-30 Thread Ivan Sagalaev
cyberco wrote: > ==VIEW= > errors = {} > pizza = > new_data = pizza.__dict__ This is why it doesn't work. There is a method in manipulators 'flatten_data' that correctly fills data for ForeignKeys and ManyToMany: manipulator = Pizza.ChangeManipulator(id) # or whatever

Re: ManyToManyField not populated in form

2006-08-30 Thread cyberco
I'm using manipulators. ==MODELS== class Pizza(models.Model): toppings = models.ManyToManyField(Topping) class Topping(models.Model): name = models.CharField(maxlength=100) === ==VIEW= errors = {} pizza = new_data =

Re: ManyToManyField not populated in form

2006-08-30 Thread Ivan Sagalaev
cyberco wrote: > In a form for changing a model instance all fields get correctly filled > with existing values except the ManyToManyField form fields (which > renders as a choice list in a form). It shows the correct list of > options, but none of the options is selected, even though the

Re: ManyToManyField not populated in form

2006-08-29 Thread [EMAIL PROTECTED]
I have the same problem :| --~--~-~--~~~---~--~~ 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