0👍
✅
i tried this one as said by @Rohan. its working fine
parts_list = tbmstpart.objects.filter(tbtrnappraisalquestion_intPartID__intTemplateID__exact=4).distinct()
1👍
You have typo of __
in tbtrnappraisalquestion__intTemplateID
rather you want tbtrnappraisalquestion_intTemplateID
, with single underscore.
Change your query to
Assuming your tbmsttemplate
model has intTemplateID
as int primary key,
parts_list = tbmstpart.objects.filter(tbtrnappraisalquestion_intPartID__intTemplateID__intTemplateID__exact=4)
#there is no typo here, you have to do __intTemplateID__intTemplateID as your pk field in `tbmsttemplate` and FK `tbtrnappraisalquestion` are same
- [Answer]-User Registration Experience: Email Generated Password?
- [Answer]-How to show a value from model related to other model?
- [Answer]-Static files (images, css) are not being served Openshift 2014, Django 1.4 and Python 2.7
- [Answer]-Django HttpResponseRedirect with reverse is not working
- [Answer]-No ReverseMatch : password reset activation email is not working in django?
Source:stackexchange.com