Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

limit_choices_to don't play well with ModelChoiceField #7

Open
avoine opened this issue Jun 12, 2011 · 0 comments
Open

limit_choices_to don't play well with ModelChoiceField #7

avoine opened this issue Jun 12, 2011 · 0 comments

Comments

@avoine
Copy link

avoine commented Jun 12, 2011

Using limit_choices_to cause a validation error when you save tasks because it's used by the ForeignKey validation.

I suggest to remove the limit_choices_to constraint since you validate the input with your form already.
I'm not sure if this have consequences else where.

By the way, that for sharing your project :)

diff --git a/bltask/models.py b/bltask/models.py
index 6b7e977..be5bacd 100644
--- a/bltask/models.py
+++ b/bltask/models.py
@@ -69,7 +69,6 @@ class Task(MP_Node):
                                     null=True,
                                     blank=True,
                                     related_name='assigned_tasks',
-                                    limit_choices_to={'project_members__slug': 'self.tasks.slug'},
                                     verbose_name=_(u'assigned to'))
     
     created_by = models.ForeignKey(User,
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant