Skip to content
Advertisement

Tag: django

django getting all objects from select

I also need the field (commentGroupDesc) from the foreign keys objects. models.py views.py Here I get the commentGroup fine but I also need commentGroupDesc to put into my form. Answer At first, it’s not a good thing to name same your model field as model name which is commentGroup kindly change field name, and run migration commands. You can simply

How to give the data to serializer with JSONField

I have model and serializer with JSONField Then,I want to set the data to serializer class, However some how serializer.is_valid() faild. I have tested two pettern data1 data2 What data should I give to this serializer? And is there any method to debug is_valid()? Answer You are giving the data in right way, but as you are updating partially, you

PUT or PUSH for modifying the existing data?

I have viewset, Which shows the view on /api/companys There is a button for POST I can add the new data from this form. Now I want to modify the existing data. I have basic questions. PUSH can modify the data? or PUT should be implemented? How PUT can be implemented for ModelViewSet? Answer Mainly for updating(modify) data using PATCH

Advertisement