Skip to content

Commit

Permalink
Merge pull request pallets-eco#1420 from pawl/fix_1223
Browse files Browse the repository at this point in the history
use property name rather than db column name for form_choices
  • Loading branch information
mrjoes authored Jan 29, 2017
2 parents b7ace5d + 53d9d62 commit 45ffcf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flask_admin/contrib/sqla/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def convert(self, model, mapper, name, prop, field_args, hidden_pk):
form_choices = getattr(self.view, 'form_choices', None)

if mapper.class_ == self.view.model and form_choices:
choices = form_choices.get(column.key)
choices = form_choices.get(prop.key)
if choices:
return form.Select2Field(
choices=choices,
Expand Down Expand Up @@ -537,7 +537,7 @@ def process_ajax_refs(self, info):
def _calculate_mapping_key_pair(self, model, info):
"""
Calculate mapping property key pair between `model` and inline model,
including the forward one for `model` and the reverse one for inline model.
including the forward one for `model` and the reverse one for inline model.
Override the method to map your own inline models.
:param model:
Expand Down

0 comments on commit 45ffcf8

Please sign in to comment.