Commit a76c004d authored by Serge S. Koval's avatar Serge S. Koval

Do not create relation if form_columns is set and it is missing in the list

parent d615e70a
......@@ -95,6 +95,11 @@ class AdminModelConverter(ModelConverterBase):
return QuerySelectField(**kwargs)
def _convert_relation(self, prop, kwargs):
# Check if relation is specified
form_columns = getattr(self.view, 'form_columns', None)
if form_columns and prop.key not in form_columns:
return None
remote_model = prop.mapper.class_
column = prop.local_remote_pairs[0][0]
......
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