Commit a989bcf4 authored by John Rork's avatar John Rork

Don't use column name for pk

Gets the attribute name of the model's pk column, rather than the
column's name (which can differ).

This probably needs to happen for inherited keys, too, but I have not
tested.
parent ccfa163f
......@@ -31,7 +31,7 @@ def get_primary_key(model):
if is_inherited_primary_key(p):
pks.append(get_column_for_current_model(p).key)
else:
pks.append(p.columns[0].key)
pks.append(p.key)
if len(pks) == 1:
return pks[0]
elif len(pks) > 1:
......
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