-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ManyToOneRel can't be serialized #32
Comments
Hi, I added a use case in the test model here but can't replicate, do you have more informations ? django version, models used, any customizations of the serializer ? |
My apologies, I've got this problem on serializing ManyToOne relation like this:
And yes, I'm using custom serializer to solve this problem. |
Hi, so the problem is that in the serializer for some reason 'field' is not an instance of Field but ManyToOneRel which is not a subclass of Field. |
Here is the AgencyEsSerializer, with custom serializer for this field:
And here is the code, causing the problem:
|
Hi, the problem is that reverse relationships are not implemented, it's a big blunder so thx for pointing it out. I started a PR it should solve your problem but it will requires more work before i can merge it. |
Tnx a lot for this patch and for whole module of cause! 👍 |
ManyToManyField with 'through' Model bring us to some problems
Error on line 118 in django_elasticsearch/serializers.py:
AttributeError: 'ManyToOneRel' object has no attribute 'rel'
The text was updated successfully, but these errors were encountered: