How to call field from Serializers.py to views.py

Viewed 48

I am learning it.

So there is a field called password in serializers.py I want to call that field in views.py. The password field is randomly generated. I want to get this field. How do I achieve this?

1 Answers

write serializer methods in serializers.py (like - add, update, list and all) and pass request data from views to serializer via context if you need to access request.user or request.data. And apply your logic in serializer.

Related