Re: something I really don't know in using manage.py shell

2007-08-02 Thread oggie rob
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

Re: something I really don't know in using manage.py shell

2007-08-02 Thread Lucky B
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=

Re: something I really don't know in using manage.py shell

2007-08-02 Thread johan de taeye
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,

something I really don't know in using manage.py shell

2007-08-01 Thread james_027
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,