Yes. "filter" returns a set (hence the [] around "",
indicating a collection). If you are using a pk, where you can
guarantee a single returned value, use "get":
>>> p = Profile.objects.get(id=1)
>>> p.department
-rob
On Aug 1, 10:35 pm, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> i am tryin
You should be doing
>>> p = Profile.objects.get(id=1)#or .get(1) or one of the many other
>>> posibilities
filter returns a list of the results, in the case of id=# it probably
returns only one, but it's still a list of one member.
So in your case it would work if you did this:
>>>p= Profil
I suspect you get this error because "level" is a reserved keyword in
many databases.
Try renaming the field.
Johan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
hi,
i am trying to use the manage.py shell, for fast testing of what I
would like to do.
I have a model like this
class Function(models.Model):
"""Functions that KSK Employee account could use"""
name = models.CharField(maxlength=40)
url = models.CharField(maxlength=40, default='/'
4 matches
Mail list logo