Re: '_QuerySet' problem

2007-08-05 Thread SmileyChris

On Aug 6, 1:15 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On 05-Aug-07, at 6:19 PM, Marco A. wrote:
>
> > >>> p.user
>
> p.User

Umm, this is just as wrong.

Doug's answer summed it up pretty well.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: '_QuerySet' problem

2007-08-05 Thread Kenneth Gonsalves


On 05-Aug-07, at 6:19 PM, Marco A. wrote:

> >>> p.user

p.User
-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: '_QuerySet' problem

2007-08-05 Thread Doug B

A queryset is kind of like a list, you can slice it, access by index,
or iterate through it.  I'm not quite sure what you are trying to do,
but to access the individual user objects you have to fetch them from
the queryset somehow:

users = User.objects.all()

by index:
print users[0].user
print users[1].user

by loop:
for user in users:
print user.user




--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



'_QuerySet' problem

2007-08-05 Thread Marco A.
Hi to all !
I doesnt undestand where is the problem whit Query set.. (or maybe what is
query_set)

If the models is :


class User(models.Model):
user = models.CharField(maxlength=12)
passw = models.CharField(maxlength=20)












I doest undestand this shell session :

>>> User.objects.all()
[, ]
>>> p.user
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: '_QuerySet' object has no attribute 'user'

(doesnt worry about two pippo user name.. for now.. I will fix now)

Where is the error ?

Thanks !

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---