2👍
This was a bug in Django 1.8, see #25274. It has been fixed in 1.8.8. You should upgrade to the latest 1.8.x version.
Note that minor version upgrades, from 1.8.x to 1.8.x+1, only include bugfixes and security updates. You should always aim to use the latest minor version. Only major version upgrades, from 1.Y to 1.Y+1, may break compatibility as outlined in the deprecation timeline.
0👍
django’s inspectdb took my legacy field names as the field names for unique_together. I changed this so it used the properties in the model, and that solved the problem. I also added the _ before the id, as stated in the google groups post listed above. But I am not sure if that underscore was relevant. Right now, I don’t want to mess with my set up, so I leave the test with the underscores (or rather without underscores) to someone else. 🙂 If I have time to test that, I will post what I find here.
Here is my working model code:
class Pagescanannotationscommentaries(models.Model):
pagescanannotation_id = models.IntegerField(db_column='pageScanAnnotationId') # Field name made lowercase.
commentary_id = models.IntegerField(db_column='commentaryId') # Field name made lowercase.
class Meta:
managed = False
db_table = 'PageScanAnnotationsCommentaries'
unique_together = (('pagescanannotation_id', 'commentary_id'),)
This change made the error message disappear.
- [Answered ]-Employing caching for the first page of a paginated view in Django
- [Answered ]-Django TemplateDoesNotExist and BASE_DIRS
- [Answered ]-What's this after aggregation in django?
- [Answered ]-How to temporarily disable foreign key constraint in django
- [Answered ]-Django access m2m field attribute from a queryset