> -----Original Message----- > From: django-users@googlegroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of patrickk > Sent: 19 August 2008 14:12 > To: Django users > Subject: limit choices to logged-in user > > > is there a way to limit choices (using foreign key) to the > logged-in user? > > I´ve tried limit_choices_to = {'user': request.user}, but > that is obviously not working since "request" is not available. > > any ideas?
What are you trying to do exactly? Is this to auto populate some kind of form, or just for data integrity? If I have a model that has a user field, and I want it to be the remote user, I normally just set this in my view. Not sure if this is the best thing to do but it seems to work for me. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---