django-compositekey
django-compositekey copied to clipboard
Attempt to append to unique_together tuple
Trying out django-compositekey on a legacy database created with inspectdb, it appears as though an attempt is made to append to the unique_together tuple:
... File "/xxx/.virtualenvs/xxx/lib/python2.7/site-packages/compositekey/db/models/fields/multiplekey.py", line 71, in lazy_init cls._meta.unique_together.append(names) AttributeError: 'tuple' object has no attribute 'append'
PS: I'm trying this out with 1.7, but looking back through previous releases of Django, unique_together always has been a tuple?
Hi, please try with django 1.5. Django support 1.6 and 1.7 is working in progress. Django 1.6 has changed the ORM join part.
Like I said, it appears to have always been a tuple, even with 1.5, thought you might like to know
Got it, thanks. Can you post a simple test to replicate the issue? I'll add in the test suite.
Now I remember, I wrote a couple of years ago in the wiki tha inspectdb is not supported yet. https://github.com/simone/django-compositekey/wiki Anyway, the append should be changed in a new tuple assignment thanks for the feedback
I have the same issue in MySql, only doing something similar to this id = db.MultiFieldPK("author", "name")