python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
AttributeError: 'NoneType' object has no attribute '_meta' while updating data using nested serializers via PATCH call in Django Rest Framework
I want to update the Model data using nested serializers via PATCH call in DRF.
I have custom User Model, Country, City, Detail Model.
I have MainUserSerializer, CountrySerializer, CitySerializer and ...
Neha AK
Votes: 0
Answers: 1
Django - BaseSerializer.is_valid() missing 1 required positional argument: 'self'
I am creating a base viewset class and trying to use it in two classes.
The viewset has a create method which uses the get_serializer_class() to get the serialzer and creates the object.
But the is_va...
Sardar Faisal
Votes: 0
Answers: 1
DRF - How do you include foreign data within a Serializer?
I have a Model that looks a bit like this:
class Foo(models.Model):
data = models.ForeignKey(Data, on_delete=models.CASCADE)
source = models.ForeignKey(Source, on_delete=models.CASCADE)
# ...
nebulaeandstars
Votes: 0
Answers: 0
How do I get my CreateAPIView to recognize the "validate' seciton of my serializer?
I'm using Django 3.2 and Django rest framework 3.12.2 and have django.contrib.auth installed. I would like to create an endpoint to create users, so I have set this up in my views ...
class CreateUse...
Dave
Votes: 0
Answers: 1