#34443 closed Bug (fixed)
Filtering reverse relations against invalid lookups crashes.
Description ¶
Filtering reverse relations against invalid lookups crashes.
from django.db import models class Author(models.Model): name = models.CharField(max_length=10) class Report(models.Model): name = models.CharField(max_length=10) creator = models.ForeignKey(Author, models.CASCADE) >>> Author.objects.filter(report__title="first") ... File "/django/django/db/models/expressions.py", line 380, in get_transform return self.output_field.get_transform(name) AttributeError: 'ManyToOneRel' object has no attribute 'get_transform'
In Django 4.1 it raises django.core.exceptions.FieldError: Related Field got invalid lookup: title
.
Regression in ce6230aa976e8d963226a3956b45a8919215dbd8.
Change History (4)
comment:1 by , 2 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 2 years ago
Has patch: | set |
---|
Note:
See TracTickets
for help on using tickets.
PR