Hi

I have two simple models with a OneToMany connection

class Student(models.Model):
    last_name = models.CharField(maxlength=60)
    first_name = models.CharField(maxlength=60)

class Grade(models.Model):
    mark = models.CharField(maxlength=1, choices=MARK_CHOICES)
    student = models.ForeignKey(Student)

I'd like to print out a particulary student's marks
in sql syntax:
SELECT * FROM naplo_grade WHERE student_id = proper id

I couldnt figure out how to write it in python/django
ive tried for example
  Grade.objects.filter(student_id=1)
but of course it didnt work...
Could you tell me a great solution?

(im a newbie in this python/django world)

thanks in advance
 Viktor


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

Reply via email to