1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #30661 -- Added models.SmallAutoField.

This commit is contained in:
Nick Pope
2019-07-26 22:05:22 +01:00
committed by Mariusz Felisiak
parent 955b382600
commit 194d1dfc18
28 changed files with 177 additions and 26 deletions

View File

@@ -9,6 +9,11 @@ class City(models.Model):
return self.name
class Country(models.Model):
id = models.SmallAutoField(primary_key=True)
name = models.CharField(max_length=50)
class District(models.Model):
city = models.ForeignKey(City, models.CASCADE, primary_key=True)
name = models.CharField(max_length=50)