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='/')
method = models.CharField(maxlength=40, default='index')
class Profile(models.Model):
"""KSK Employee accounts to use this application"""
user = models.ForeignKey(User, unique=True)
department = models.CharField(maxlength=3,
choices=DEPARTMENT_LIST)
level = models.CharField(maxlength=2, choices=LEVEL_LIST)
functions = models.ManyToManyField(Function, blank=True)
when I do in the shell
>>>p = Profile.objects.filter(id=1)
>>>p
[<Profile: james>]
but when I did this
>>>p.department
it say
AttributeError: '_QuerySet' object has no attribute 'level'
is there anything I should know?
THanks
james
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---