Commit 45ffcf89 authored by Serge S. Koval's avatar Serge S. Koval Committed by GitHub

Merge pull request #1420 from pawl/fix_1223

use property name rather than db column name for form_choices
parents b7ace5d2 53d9d629
...@@ -243,7 +243,7 @@ class AdminModelConverter(ModelConverterBase): ...@@ -243,7 +243,7 @@ class AdminModelConverter(ModelConverterBase):
form_choices = getattr(self.view, 'form_choices', None) form_choices = getattr(self.view, 'form_choices', None)
if mapper.class_ == self.view.model and form_choices: if mapper.class_ == self.view.model and form_choices:
choices = form_choices.get(column.key) choices = form_choices.get(prop.key)
if choices: if choices:
return form.Select2Field( return form.Select2Field(
choices=choices, choices=choices,
...@@ -537,7 +537,7 @@ class InlineModelConverter(InlineModelConverterBase): ...@@ -537,7 +537,7 @@ class InlineModelConverter(InlineModelConverterBase):
def _calculate_mapping_key_pair(self, model, info): def _calculate_mapping_key_pair(self, model, info):
""" """
Calculate mapping property key pair between `model` and inline model, 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. Override the method to map your own inline models.
:param model: :param model:
......
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