#33011: my_model.manyrelation_set.all() return empty value
-------------------------------------+-------------------------------------
Reporter: Floréal | Owner: nobody
Cabanettes |
Type: Bug | Status: new
Component: Database | Version: 3.2
layer (models, ORM) |
Severity: Normal | Keywords: model set querying
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I have a problem which occurred since django 3.2 (no problem with django
3.1).
I use django rest framework. On the view, I have a model "Run" and a model
"Experiment". On the view, I get experiments with :
my_experiments = my_run.experiment_set.all()
But since django 3.2, this returns an empty queryset. If I add a
breakpoint in pycharm just after this line, the queryset is no more empty.
Also, this line works perferctly:
my_experiments = Experiment.objects.filter(run_id=my_run.id)
But I think the first code is more beautiful... so why this problem?
--
Ticket URL: <https://code.djangoproject.com/ticket/33011>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.ef6b28efa91decb23e8ffabd94687b69%40djangoproject.com.