1👍
If using BeneficientPager, you need to do
BeneficientePagar.objects.filter(beneficient__nome__contains="Joao Pedro")
0👍
You are getting the error because nome
is a field on Beneficiente
, not BeneficientePagar
.
You can either do
Beneficiente.objects.filter(nome__contains="Joao Pedro")
which will return a queryset of Beneficiente
s. Or if you need BeneficientePagar
you can query through the foreign key.
BeneficientePagar.objects.filter(beneficiente__nome__contains="Joao Pedro")
- [Answer]-Select_related django. Why i can't using select_related in my project?
- [Answer]-Angular's ng-repeat with predefined markup
- [Answer]-Django redirect still allows post on reload only on mobile Chrome
- [Answer]-Heroku postgis makemigrations error geodjango
Source:stackexchange.com