-
Notifications
You must be signed in to change notification settings - Fork 10
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
How to use drf_turbo serializer #9
Comments
Can you show me your code please? |
I can't see any errors in the console, all I see is the instance of the serializer only. |
Did you checked the both pictures I attached with the issue |
I can't see where do you use the serializer, please update your code with a clear example. |
Hello, Description
The error appears when nested serializer called. |
Hello @DarViSte, Can you share any examples that I can test? |
@Mng-dev-ai here is what I have:
serializer.py
apiviews.py
Error is:
This structure looks very similar to what I have in my code |
Thank you @DarViSte
btw, you must add |
Hello @Mng-dev-ai P.S. I put the context as parameter just forgot to write it :) |
Not sure what you mean by getting the whole queryset at once
…On Wed, 21 Sep 2022 at 10:15 PM Daria Step ***@***.***> wrote:
Hello @Mng-dev-ai <https://github.com/Mng-dev-ai>
Thank you very much for your help. The error is solved now.
Just one question. When I call regular serializer serialization runs one
by one, but when I call drf-turbo it gets whole queryset at once. Is it how
it work or I do something wrong.
P.S. I put the context as parameter just forgot to write it :)
—
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMAM57TWOGGY6LKQV73YHLTV7NUHFANCNFSM5WYWCNGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@Mng-dev-ai I'll try to explain. I have now two serializers, old one and drf-turbo, when I run query first with one and then with another I have a different result:
it prints out:
When I call drf-turbo serializer, result for print(xxx) is:
I have a feeling that it is some small bug in my script which I do not see |
Hello @Mng-dev-ai Thank you very much for your help. Looks like that the question above is still on the surface :) Is it so that drf-turbo works with single objects, not sets?
user is just one object not a set of the same objects. |
The way
Conclusion: If you need to override serialize method then you need to add some extra code than what you used to do in
My main goal when I created this package was to be fast as possible so I had to give up some features to achieve that but I might change that in the future |
@Mng-dev-ai Thank you for your advice! I'll try the logic which you've suggested. |
Description
I am trying to save data in the postgres using django with the serializer implemented in cython
What I Did
I followed the process you written in the documentations but the cython build i didn't know how to build and if i use dt.serializer it gives me in save no object has no attribute 'create' and if i use dr.ModelSerializer
The text was updated successfully, but these errors were encountered: