Use Two Serializers in two methods in One Class ListCreateAPIView

2022-12-16 Thread Saifullah Shahen
Hi, In *ModelViewSet *we can use following code to change my serializer according my method here , def get_serializer_class(self): if self.action == 'list': return MovieRatingSerializer else: return self.serializer_class But can in ListCreateAPIView, i cannot use the same lo

Re: Change all default table name

2022-12-16 Thread Saifullah Shahen
class TempUser(models.Model): first_name = models.CharField(max_length=100) class Meta: db_table = "temp_user" # you can write any name here that will be set in your database table name. but you can call in django app as TempUser. On Wednesday, December 14, 2022 at 4:31