I need help understanding the results of following queries

Bacground. I have 4 trans objects in database. 2 which are related to
poll objects and 2 which are related to another content type. each of
those 2 has 1 objec where keel = 1 and 2 where keel = 2. I want this
single poll related Trans where keel = 1.

1) This gives me 2 results, while i think it should give just one:
q = ContentType.objects.get_for_model(self)
z = Trans.objects.get(content_type__pk=q.id, object_id=self.id).exclude
(keel=2)
t = z.name

2) this gives me no results, while i think it should give me one:
z = Trans.objects.filter(poll = self).exclude(keel = 2)
t = z.name

3) This also gives me 2 results while i want just one:
z = Trans.objects.filter(poll = self)
q = z.get(keel = 1)
t = q.name

Please help me understand why they work the way they do.
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to