1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

[1.7.x] Fixed #23009: Shorten FK identifiers in add_field and make consistent

This commit is contained in:
Andrew Godwin
2014-07-21 10:50:21 +01:00
parent f57e84392e
commit 88135a8cf7
3 changed files with 41 additions and 14 deletions

View File

@@ -129,8 +129,16 @@ class UniqueTest(models.Model):
unique_together = ["year", "slug"]
class AuthorWithEvenLongerName(models.Model):
name = models.CharField(max_length=255)
height = models.PositiveIntegerField(null=True, blank=True)
class Meta:
apps = new_apps
class BookWithLongName(models.Model):
author_foreign_key_with_really_long_field_name = models.ForeignKey(Author)
author_foreign_key_with_really_long_field_name = models.ForeignKey(AuthorWithEvenLongerName)
class Meta:
apps = new_apps