- Previous thread: How does my Model gets the objects attribute
- Next thread: Catch an IntegrityError in views to get back pk value of prexisting model
- Threads sorted by date: django 200907
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??
bow
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
2009/7/1 newlife :
>
> 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 django-users@googlegroups.com
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Related Threads
- DNSSEC - bind
- svn commit: r940283 - /tomcat/trunk/test/org/apache/catalina/mbeans/RegistrationTest.java - tomcat
- openssl enc block size - openssl
- Hendrix - STOP with the download update constant offer....PLEASE - firefox
- python-win32 - ASP, IIS, win32 and Python 3.1 - python
- svn commit: r943151 - /tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java - tomcat
- Bug#582133: ITP: libpod-weaver-perl -- Perl module to weave together a Pod document from an outline - debian
- Bug 22857 - New: Starcraft 2 Editor crashes when the Data Editor gets opened. - wine
- Hendrix - abstürze von firefox - firefox
- Bug 22958 - New: Missing disc icon on CDBurnerXP's progress dialog - wine
- Re: Inkscape-devel - Re : Re : Re : I suck at Perl (orcheck-markup) - inkscape
- No common CD-ROM drive was detected - debian