Commit c2c7ce95 authored by dantezhu's avatar dantezhu

ONETOMANY should not be InputRequired too.

parent f820bd9e
......@@ -106,10 +106,8 @@ class AdminModelConverter(ModelConverterBase):
kwargs['label'] = self._get_label(prop.key, kwargs)
kwargs['description'] = self._get_description(prop.key, kwargs)
if column.nullable:
if column.nullable or prop.direction.name != 'MANYTOONE':
kwargs['validators'].append(validators.Optional())
elif prop.direction.name != 'MANYTOMANY':
kwargs['validators'].append(validators.InputRequired())
# Contribute model-related parameters
if 'allow_blank' not in kwargs:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment