-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
Description
Suppose we have two models: Patient and Slot.
class Slot(Model):
...
email = EmailField(...)
patient = models.ForeignKey(
'patients.Patient',
related_name='slots',
related_query_name='slot',
...
)
And then we need to filter patients by related slot.
def get_patients():
...
# patients is queryset of patients.Patient
return patients.filter(slot__email__isnull=True)
It's simple and working code. But when we try to mock get_patients with MockSet of patients created with fabric we get an error.
django.core.exceptions.FieldError: Cannot resolve keyword 'slot' into field. Choices are ...'slots', ...
If we change filter to slots__email__isnull=True, it works in tests. But now we get an error in Django shell.
django.core.exceptions.FieldError: Cannot resolve keyword 'slots' into field. Choices are: ... 'slot', ...
It would be great to fix this! Thanks. 😊