2009/7/1 newlife <[email protected]>:
>
> class company(models.Model):
>    on=models.BooleanField()
> class work(models.Model):
>        company=models.ForeignKey
> (company,related_name='vote_company',)
>
>      。。。。
>      。。。。
>
> how can I get the works those company.on is true??

work.objects.filter(company__on=True)

The django documentation is a good place to look at
(http://docs.djangoproject.com/en/dev/topics/db/queries/#lookups-that-span-relationships)

-- 
Kind Regards

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

Reply via email to