I simply want to implement a custom create() method on my ModelViewSet 
subclass that calls set_password() with a posted password on the created 
object. I am using my User class as a custom Django user class and when I 
try to serialize the password field directly (which is not explicitly 
declared on the model) it does not do anything. I have to be able to call 
set_password after, or in the process of, creating the object. I tried 
overriding various methods in my viewset as well as my serializer but to no 
effect. Strange thing is, when I try to override create() on the viewset 
and call set_password() after serializer.save(), I get a uniqueness 
constraint error on my username field though the object being created isn't 
even in the dtabase yet. Why is this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to