You have to replace the field with relevant model field name in your
identification Model.
On Thu, 30 Mar 2023, 18:07 Amed Sheriff, wrote:
> Hello @Umair Ramzan,
>
> Please with your approach i am getting this error.
> Code:
>
> userid = serializers.SlugRelatedField(
&g
You can overrite the to_internal_value method in the serializer.
Field - candidate key
---
def to_internal_value(self, data):
userid = Identification.obejcts.get(field=data["userid"]).id
resource = data.copy().update({'userid':userid})
return super().to_internal_value(resource)
On
Can you provide a bit of context what you are trying to do? Do you want
your users to execute code on your server?
On Mon, 12 Sep 2022, 11:25 Sohail Khan,
wrote:
> hey guys can we print output of a command which has been executed on
> terminal to a html page in django its possible in python but
bscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/df9f2e2b-1608-4a22-b66d-6636f63cb1c2n%40googlegroups.com
> &l
To implement safe delete you have to override the model's delete
functionality. There is nothing to do with restframework.
Also there exists a package called djago-safedelete.
On Mon, 5 Sep 2022, 15:59 Sohail Khan,
wrote:
> hey guys can we implement safe delete in django rest framework if yes h
By default browsers makes GET requests. So you need to use some other
Clients such as postman to test your api.
On Fri, 5 Aug 2022, 13:00 Salima Begum,
wrote:
> Hi,
> I am new to Django rest framework. In my project I have written api view
> for phone OTP verification there If I use api_view(['P
You can always use the functions avaible on Django Queryset and Models. You
can build your business logic by manipulating the data. a better way to do
this is to separate your business logic from the view and models. you can
always write a function let's say "def my_business_logic" with all the