Commit b9c153d3 authored by Iurii Ogiienko's avatar Iurii Ogiienko

Update flask_admin/contrib/peeweemodel/tools.py

Peewee allow to create PrimaryKeys like IntegerField(primary_key=True)
parent d291c236
......@@ -3,7 +3,7 @@ from peewee import PrimaryKeyField
def get_primary_key(model):
for n, f in model._meta.get_sorted_fields():
if type(f) == PrimaryKeyField:
if type(f) == PrimaryKeyField or f.primary_key:
return n
......
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