Re: How to make field readonly for update.

2020-05-05 Thread zhong ming wu
1. You can override `.save` method of a model and detect that it is an update operation like this ``` def save(self, *args, **kwargs): if not self._state.adding: … ``` According to https://docs.djangoproject.com/en/3.0/re

Re: Handling expired verification when using DJANGO-REST-AUTH

2020-04-14 Thread zhong ming wu
, was that I was lost on how to redirect the user > instead of getting that error. > > On Monday, 13 April 2020 18:38:25 UTC+1, zhong ming wu wrote: > The html page you see is likely a django template in that project > `django-rest-auth` . You should be able to locate and edit th

Re: Handling expired verification when using DJANGO-REST-AUTH

2020-04-13 Thread zhong ming wu
The html page you see is likely a django template in that project `django-rest-auth` . You should be able to locate and edit that template to your need. Alternatively, you can write your own endpoint for verification. > On Apr 13, 2020, at 13:31, Opeyemi Odedeyi wrote: > > good day, I am

jsonrenderer not working with test client

2020-03-17 Thread zhong ming wu
I have been successfully using django test client to examine responses from http requests from DRF; I am not using request factory of any kind. However I have just found out that even though the output from the view (using jsonrenderer ) examined with the browser properly turns UUID objects in