Skip to content

Commit f657e00

Browse files
committed
Remove python2 compatibility decorator
1 parent da1c21a commit f657e00

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/core/models.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
from django.core.exceptions import ValidationError
55
from django.db import models
6-
from django.utils.encoding import python_2_unicode_compatible
76

87

9-
@python_2_unicode_compatible
108
class Author(models.Model):
119
name = models.CharField(max_length=100)
1210
birthday = models.DateTimeField(auto_now_add=True)
@@ -24,7 +22,6 @@ def full_clean(self, exclude=None, validate_unique=True):
2422
raise ValidationError({'name': "'123' is not a valid value"})
2523

2624

27-
@python_2_unicode_compatible
2825
class Category(models.Model):
2926
name = models.CharField(
3027
max_length=100,
@@ -35,7 +32,6 @@ def __str__(self):
3532
return self.name
3633

3734

38-
@python_2_unicode_compatible
3935
class Book(models.Model):
4036
name = models.CharField('Book name', max_length=100)
4137
author = models.ForeignKey(Author, blank=True, null=True, on_delete=models.CASCADE)
@@ -51,15 +47,13 @@ def __str__(self):
5147
return self.name
5248

5349

54-
@python_2_unicode_compatible
5550
class Parent(models.Model):
5651
name = models.CharField(max_length=100)
5752

5853
def __str__(self):
5954
return self.name
6055

6156

62-
@python_2_unicode_compatible
6357
class Child(models.Model):
6458
parent = models.ForeignKey(Parent, on_delete=models.CASCADE)
6559
name = models.CharField(max_length=100)
@@ -89,10 +83,12 @@ class WithDefault(models.Model):
8983
name = models.CharField('Default', max_length=75, blank=True,
9084
default='foo_bar')
9185

86+
9287
def random_name():
9388
chars = string.ascii_lowercase
9489
return ''.join(random.SystemRandom().choice(chars) for _ in range(100))
9590

91+
9692
class WithDynamicDefault(models.Model):
9793

9894
name = models.CharField('Dyn Default', max_length=100,

0 commit comments

Comments
 (0)