Closed khoobks-gaiaresources closed 12 years ago
thanks for your support.
check if it is ok https://github.com/simone/django-compositekey/commit/b844b18b52dfa7a052ec3fabf5226a121604b69e
Thanks for putting in the fix so quickly!
I'll give it a test on Monday when I am back in the office.
Works as advertised.
Thanks again!
The composite primary key of an m2m join table row appears to be incorrect if it consists of two other model objects (instead of a varchar for example).
This is best demonstrated with an example
The issue is that the primary key of the book author (ba.pk) is not unique when quering the python instance.
The fix for this issue is relatively simple and a patch is included. https://gist.github.com/3957348
The only thing that needs to be modified is the function assemble_pk in utils.py where a check has been added to test if one of the "values" is a django Model.
The patch was generated using the version of the code on PyPI (which I noticed is slightly different to the one in github)