On Thu, 2008-11-27 at 00:43 -0800, izzy wrote:
> Okay, thanks. That would be my last resort..
>
> But not all users can create reports. I only want to users that have
> created a report.. I doubt that django don't support this kind of
> query. I hope not.
So filter on the Users that can create
sorry, just got it. that's not the right answer to your question.
On Nov 27, 10:38 am, tom <[EMAIL PROTECTED]> wrote:
> hey,
>
> please don't shoot me if i got it wrong. but i would try this:
>
> report = Reports.objects.filter(author__in = [John, Karl, Jens, Sepp]
>
> Maybe you have to create a
hey,
please don't shoot me if i got it wrong. but i would try this:
report = Reports.objects.filter(author__in = [John, Karl, Jens, Sepp]
Maybe you have to create a more suitable list with Author objects.
let me know, if this has solved your issue.
On Nov 27, 9:43 am, izzy <[EMAIL PROTECTED]>
Okay, thanks. That would be my last resort..
But not all users can create reports. I only want to users that have
created a report.. I doubt that django don't support this kind of
query. I hope not.
let me elaborate it again.
Reports have following fields in models.py:
title
category
On Nov 27, 12:54 am, izzy <[EMAIL PROTECTED]> wrote:
> I still don't get it.
"distinct()" is a queryset method for the "objects" manager, just like
"all()" is. Since author is a link to the "auth.models.User" class,
you would list all unique users with:
users = auth.models.User.objects.distinct
I still don't get it.
reports = Report.objects.all()
author = # how can I retrieve all author names (author names
should be unique)
I can't figure it out. please give me direct answer..
--~--~-~--~~~---~--~~
You received this message because you are subscrib
On Wed, 2008-11-26 at 19:43 -0800, izzy wrote:
> Hi all.
>
> I'm new to Django and I would like to get the unique values of a field
> in a model.
>
> For example:
>
> Class Report(models.Model):
> title = models.Charfield
> category = models...
> author = models.ForeignKe
7 matches
Mail list logo