Re: Admin Model Validation on ManyToMany Field

2010-07-15 Thread Heleen
Thanks very much for your reply! I got it working now. At first I couldn't get my head around how it would work using the clean of the intermediary model. But after a night's sleep it made sense to me. In the Admin my Permission model (the users field) is an inline of Application and when I put the

Re: Admin Model Validation on ManyToMany Field

2010-07-14 Thread jaymzcd
Hi Heleen, I think this is because your running the users through an intermediate model. That changes the way you need to work with the M2M data. You should be working on the Permission model/objects instead. If you check out the M2M docs for models via an intermediate: http://docs.djangoproject.

Re: Admin Model Validation on ManyToMany Field

2010-07-14 Thread Nuno Maltez
On Wed, Jul 14, 2010 at 3:50 PM, Nuno Maltez wrote: > Sorry, I can't reproduce your error with django 1.2. > > I copied your models (just removed the intermediaty "Permission" > because I don't know your User model) into a new app and I have 2 Oops, forgot to add i made the ManyToMany a relation

Re: Admin Model Validation on ManyToMany Field

2010-07-14 Thread Nuno Maltez
Sorry, I can't reproduce your error with django 1.2. I copied your models (just removed the intermediaty "Permission" because I don't know your User model) into a new app and I have 2 scenarios Adding an Application in the admin: a) if I select a User and Folder, the validation runs just fine b)

Re: Admin Model Validation on ManyToMany Field

2010-07-14 Thread Heleen
Thank you for your reply. Yes I have selected a user and folder. I believe ManyToMany fields are always optional (hence many to many). So my users and company fields are optional, but my folder field isn't. When I add a new Application in the Admin I do specify a folder and users (if I don't I wou

Re: Admin Model Validation on ManyToMany Field

2010-07-14 Thread Nuno Maltez
Hi, Just a guess: have you actually selected a user and a folder when submitting the form? I think only valid field are present on the cleaned_data dict, and your users and folder fields are not optional (blank=True, null=True). hth, nuno On Tue, Jul 13, 2010 at 1:45 PM, Heleen wrote: > Hello,