If you're using the svn release, you can filter directly on the user
using the backwards relationship filtering thing.
users=User.objects.filter(userprofile_set__team=team)
Where userprofile_set is the related_name given in the userprofile's
'user' FK declaration.
On Jun 30, 12:51 am, AdamC <[E
On Mon, Jun 30, 2008 at 12:08 AM, Peter Rowell <[EMAIL PROTECTED]> wrote:
>
>> Any advice on how to query User for a particular team name?
>
> Since the relationship is between Team and UserProfile, I believe
> that's where you need to start. Something like this would work:
>
> team = Team.objects
> Any advice on how to query User for a particular team name?
Since the relationship is between Team and UserProfile, I believe
that's where you need to start. Something like this would work:
team = Team.objects.get(team=team_name)
ups = UserProfile.objects.filter(team=team)
users = [up.user for
I have two models, UserProfile and Team[2].
I want to create a Team page which lists all the users who belong to
that team. I'm not sure how to specify this in my view. [1] The
problem I run into is that team doesn't exist within User.
Any advice on how to query User for a particular team name?
4 matches
Mail list logo