Set display_field for verification_model to show model name
- Add display_field='name' to verification_model field in CodeBatchResource - RelatedFieldEditor will now display model name instead of raw JSON object
This commit is contained in:
parent
719ccd6477
commit
c65dc700ad
@ -352,6 +352,8 @@ class CodeBatchResource(BaseResource):
|
|||||||
schema['fields']['description']['longtext'] = True
|
schema['fields']['description']['longtext'] = True
|
||||||
self.annotate_field(schema, 'code__count', '序列码数量')
|
self.annotate_field(schema, 'code__count', '序列码数量')
|
||||||
self.annotate_field(schema, 'tenant__username', '租户')
|
self.annotate_field(schema, 'tenant__username', '租户')
|
||||||
|
if 'verification_model' in schema['fields']:
|
||||||
|
schema['fields']['verification_model']['display_field'] = 'name'
|
||||||
return self.patch_product_name_schema(schema)
|
return self.patch_product_name_schema(schema)
|
||||||
|
|
||||||
class CodeResource(BaseResource):
|
class CodeResource(BaseResource):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user