Commit 2b6e0870 authored by Serge S. Koval's avatar Serge S. Koval

Merge pull request #87 from techniq/master

Don't override query_factory if passed in form_args
parents c59d33a6 1df7a581
......@@ -64,10 +64,10 @@ class AdminModelConverter(ModelConverterBase):
return override(**kwargs)
# Contribute model-related parameters
kwargs.update({
'allow_blank': local_column.nullable,
'query_factory': lambda: self.session.query(remote_model)
})
if 'allow_blank' not in kwargs:
kwargs['allow_blank'] = local_column.nullable,
if 'query_factory' not in kwargs:
kwargs['query_factory'] = lambda: self.session.query(remote_model)
if prop.direction.name == 'MANYTOONE':
return QuerySelectField(widget=form.ChosenSelectWidget(),
......
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