I am wondering how to access a user s profile when creating the queryset for a ModelChoiceField. I would like to be able to use the ModelChoiceField to display contacts from another table based on a parameter saved in the user profile i.e.
who = forms.ModelChoiceField(queryset=Contacts.objects.filter(id__exact=request.user.get_profile().main_company))
Is there a better way to do this (beyond an ajax picker in the template)?
Greg