1👍
✅
Yes you can
As you can see:
type(MyModel.objects.filter(pk=1))
<class 'django.db.models.query.QuerySet'>
type(MyModel.objects.filter(pk=1).select_related())
<class 'django.db.models.query.QuerySet'>
type(MyModel.objects.filter(pk=1).select_related().filter(name='test'))
<class 'django.db.models.query.QuerySet'>
All of them are QuerySets
0👍
I just tested it in the shell:
>>> from myApp.models import Unit_type, Transaction
>>> u = Unit_type.objects.get(pk=1)
>>> t = Transaction.objects.filter(unit_type=u)
>>> t = t.select_related().filter(transaction_end_status='R')
It didn’t give me an error and gave me a queryset with length 1.
- [Answer]-Template not looked at app level template directory in django?
- [Answer]-Alternative of PIL/Pillow for using ImageField in Django Models
- [Answer]-Why polymer not render html markup fetched from server in json format?
Source:stackexchange.com