I am sorry i forgot to mention one field which was
class Student_Info(models.Model):
Roll_No = models.IntegerField(primary_key=True)
E_mail = models.EmailField(max_length=30)
Cell_No = models.IntegerField()
Ignoring cell_no i tried
>>> recs=Academics.objects.all()
>>> recs[0]
<Academics: Academics object>
>>> obj=recs[0]
>>> obj.E_mail
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'Academics' object has no attribute 'E_mail'
Date: Mon, 8 Aug 2011 22:58:21 -0400
From: [email protected]
To: [email protected]
Subject: Re: Need help writing join Django query for this simple model..
On 08/08/2011 10:55 PM, Hayyan Rafiq wrote:
Tried that
>>> recs=Academics.objects.all()
>>> recs[0]
<Academics: Academics object>
>>> obj=recs[0]
>>> obj.Cell_No
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'Academics' object has no attribute 'Cell_No'
Am i missing something??
Yes, 'Cell_No' is completely missing from the code you provided. If
it doesn't exist, then trying to access should give exactly the
error that it did.
What do you think 'Cell_No' is or should be?
--
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.
--
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.