Hi there
I want to provide a multi-choice field which filters its results
according to some external criteria, e.g. the object belongs to a
user.
I tried something like this:
class MyForm(forms.Form):
def __init__(self, user):
self._user = user
my_options =
ModelChoiceField(queryset=SomeModel.objects.get_users_objects(self._user))
But of course it doesn't work because the main body of the class can't
access 'self'.
Any tips?
Nick.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---