for field in serializer_instance.fields.keys():
if field in {'id', '__str__'}:
continue
instance_field = serializer_instance.fields[field]
type_ = settings.WIDGET_MAPPING.get(instance_field.__class__.__name__)
if type_ is None:
raise NotImplementedError()
field_metadata = self.get_field_dict(field, serializer)
fields_metadata.append(field_metadata)
for meta_info in adapter.metadata_info:
if meta_info.attr == 'fields':
metadata['fields'] = fields_metadata,
elif meta_info.attr == 'fieldsets':
metadata['fieldsets'] = [{
'title': None,
'fields': [
{'key': field}
for field in serializer_instance.fields.keys()
if field != 'id' and field != '__str__'
]
}]
else:
metadata[meta_info.attr] = meta_info.default
Maybe it should be like
for field in serializer_instance.fields.keys():
if field in {'id', '__str__'}:
continue
instance_field = serializer_instance.fields[field]
type_ = settings.WIDGET_MAPPING.get(instance_field.__class__.__name__)
if type_ is None:
raise NotImplementedError()
field_metadata = self.get_field_dict(field, serializer)
fields_metadata.append(field_metadata)
for meta_info in adapter.metadata_info:
if meta_info.attr == 'fields':
metadata['fields'] = fields_metadata
elif meta_info.attr == 'fieldsets':
metadata['fieldsets'] = [{
'title': None,
'fields': [
{'key': field}
for field in serializer_instance.fields.keys()
if field != 'id' and field != '__str__'
]
}]
else:
metadata[meta_info.attr] = meta_info.default
line:92 metadata['fields'] = fields_metadata,
The last comma is superfluous. Option operation will returns two-tier array
line:90 for meta_info in adapter.metadata_info:
It shouldn't be indented here
metadata.py line:76
Maybe it should be like
line:92
metadata['fields'] = fields_metadata,
The last comma is superfluous. Option operation will returns two-tier array line:90for meta_info in adapter.metadata_info:
It shouldn't be indented here