> > ===== New Model ====== > > from data.models import Data > > > class Route(models.Model): > > #wday = > > models.ManyToManyField(Data.objects.filter(name='weekdays') > > I'm not sure if this is the line you are trying to get to work, but > (apart from the missing closing parenthesis) it has no chance of > working. You supply a model to ManyToManyFields, not a queryset. It also > wouldn't do what you expect in any case because the queryset would be > evaluated exactly once at import time and never again, which isn't going > to be very dynamic. > > Regards, > Malcolm
Yes this is exactly the line I am working on I don't understand what you mean with dynamic. I am trying to limit the choices in the ManyToManyFields with an sql query. Something like this: SELECT `id`, `name` FROM `data_data` WHERE `name` = 'weekdays' So that only weekdays will be available in the Select box. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---

