Commit acb3b10c authored by Rad Cirskis's avatar Rad Cirskis

fix: selection of models with composite keys

parent f5628d79
......@@ -419,6 +419,8 @@ class ModelView(BaseModelView):
return count, query
def get_one(self, id):
if self.model._meta.composite_key:
return self.model.get(**dict(zip(self.model._meta.primary_key.field_names, id)))
return self.model.get(**{self._primary_key: id})
def create_model(self, form):
......
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