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

Fixed #31762 -- Made reloading the database for tests use the base manager.

Co-authored-by: Eugene Kulak <kulak.eugene@gmail.com>
This commit is contained in:
Hasan Ramezani
2020-11-10 23:22:30 +01:00
committed by Mariusz Felisiak
parent c9e8544321
commit 50c3ac6fa9
3 changed files with 21 additions and 1 deletions

View File

@@ -21,11 +21,18 @@ class Person(models.Model):
return '%s %s' % (self.first_name, self.last_name)
class SchoolClassManager(models.Manager):
def get_queryset(self):
return super().get_queryset().exclude(year=1000)
class SchoolClass(models.Model):
year = models.PositiveIntegerField()
day = models.CharField(max_length=9, blank=True)
last_updated = models.DateTimeField()
objects = SchoolClassManager()
class VeryLongModelNameZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ(models.Model):
primary_key_is_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz = models.AutoField(primary_key=True)