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

Fixed #14286 -- Added models.BigAutoField.

This commit is contained in:
Alexander Sosnovskiy
2015-07-02 11:43:15 +03:00
committed by Tim Graham
parent a1d0c60fa0
commit 2a7ce34600
19 changed files with 260 additions and 20 deletions

View File

@@ -4,6 +4,24 @@ from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class City(models.Model):
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=50)
def __str__(self):
return self.name
@python_2_unicode_compatible
class District(models.Model):
city = models.ForeignKey(City, models.CASCADE)
name = models.CharField(max_length=50)
def __str__(self):
return self.name
@python_2_unicode_compatible
class Reporter(models.Model):
first_name = models.CharField(max_length=30)