Skip to content

Commit

Permalink
Add ModelSerializer prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
citrux committed Oct 21, 2020
1 parent e34ca07 commit 54b450a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions joey/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ class Serializer(BaseModel, metaclass=ModelMetaclass):
class Config:
orm_mode = True
getter_dict = NestedGetterDict

class ModelSerializer(Serializer):

def create(self):
self.Meta.model.objects.create(**self.dict())

0 comments on commit 54b450a

Please sign in to comment.