Sorry but I didnt get it :(
(Perhaps you should actually call the field user  rather than user) .
Could you please explain more ?

I tried to do following but couldnt get user information,

In [36]: p = PU.objects.all()

In [37]: p
Out[37]: [<PU: jwang>, <PU: admin>]

In [38]: for i in p:
   ....:     i.user.id
   ....:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call
last)

D:\PMO\<ipython console> in <module>()

AttributeError: 'ManyRelatedManager' object has no attribute 'id'


On Aug 29, 4:03 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Aug 29, 7:18 am, "[EMAIL PROTECTED]"
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > I can get user_utilization but member.user gives me django object. How
> > can I get that information?
>
> > In [199]: for member in prj_members:
> >    .....:     member.user
> >    .....:     member.user_utilization
> >    .....:
> > Out[199]: <django.db.models.fields.related.ManyRelatedManager object
> > at 0x016AD5
> > 70>
> > Out[199]: 1.0
> > Out[199]: <django.db.models.fields.related.ManyRelatedManager object
> > at 0x016ADB
> > 10>
> > Out[199]: 1.0
>
> > Thanks a lot
> >Manoj
>
> Because it's a ManyToMany field, you can have muliple users associated
> with one project. (Perhaps you should actually call the field user
> rather than user). So the field itself returns a Manager - just like
> project.objects, you have to use all() or filter() to return a
> queryset or get() to return a single user.
>
> For now you probably just want member.user.all()
>
> --
> DR.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to