def post(self, request, **kwargs):
data = json.loads(request.POST.get('data'))
fields = {
def post(self, request, **kwargs):
data = json.loads(request.POST.get('data'))
fields = {
"description_pl": "description_pl",
"plural": "plural",
"is_epoch_specific": "genre_epoch_specific",
"description_pl": "description_pl",
"plural": "plural",
"is_epoch_specific": "genre_epoch_specific",
obj = self.get_object()
for data_field, model_field in fields.items():
setattr(obj, model_field, data.get(data_field, getattr(obj, model_field)))
obj = self.get_object()
for data_field, model_field in fields.items():
setattr(obj, model_field, data.get(data_field, getattr(obj, model_field)))