mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Refs #23919 -- Removed python_2_unicode_compatible decorator usage
This commit is contained in:
parent
d7b9aaa366
commit
f3c43ad1fd
160 changed files with 23 additions and 757 deletions
|
@ -17,7 +17,6 @@ from django.core.files.storage import FileSystemStorage
|
|||
from django.db import models
|
||||
from django.utils import six
|
||||
from django.utils._os import upath
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.six.moves import range
|
||||
|
||||
temp_storage_dir = tempfile.mkdtemp()
|
||||
|
@ -40,7 +39,6 @@ class Person(models.Model):
|
|||
name = models.CharField(max_length=100)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Category(models.Model):
|
||||
name = models.CharField(max_length=20)
|
||||
slug = models.SlugField(max_length=20)
|
||||
|
@ -53,7 +51,6 @@ class Category(models.Model):
|
|||
return self.__str__()
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Writer(models.Model):
|
||||
name = models.CharField(max_length=50, help_text='Use both first and last names.')
|
||||
|
||||
|
@ -64,7 +61,6 @@ class Writer(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Article(models.Model):
|
||||
headline = models.CharField(max_length=50)
|
||||
slug = models.SlugField()
|
||||
|
@ -96,7 +92,6 @@ class BetterWriter(Writer):
|
|||
score = models.IntegerField()
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Publication(models.Model):
|
||||
title = models.CharField(max_length=30)
|
||||
date_published = models.DateField()
|
||||
|
@ -135,7 +130,6 @@ class Author1(models.Model):
|
|||
full_name = models.CharField(max_length=255)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class WriterProfile(models.Model):
|
||||
writer = models.OneToOneField(Writer, models.CASCADE, primary_key=True)
|
||||
age = models.PositiveIntegerField()
|
||||
|
@ -148,7 +142,6 @@ class Document(models.Model):
|
|||
myfile = models.FileField(upload_to='unused', blank=True)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class TextFile(models.Model):
|
||||
description = models.CharField(max_length=20)
|
||||
file = models.FileField(storage=temp_storage, upload_to='tests', max_length=15)
|
||||
|
@ -177,7 +170,6 @@ try:
|
|||
|
||||
test_images = True
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class ImageFile(models.Model):
|
||||
def custom_upload_path(self, filename):
|
||||
path = self.path or 'tests'
|
||||
|
@ -196,7 +188,6 @@ try:
|
|||
def __str__(self):
|
||||
return self.description
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class OptionalImageFile(models.Model):
|
||||
def custom_upload_path(self, filename):
|
||||
path = self.path or 'tests'
|
||||
|
@ -220,7 +211,6 @@ class Homepage(models.Model):
|
|||
url = models.URLField()
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Product(models.Model):
|
||||
slug = models.SlugField(unique=True)
|
||||
|
||||
|
@ -228,7 +218,6 @@ class Product(models.Model):
|
|||
return self.slug
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Price(models.Model):
|
||||
price = models.DecimalField(max_digits=10, decimal_places=2)
|
||||
quantity = models.PositiveIntegerField()
|
||||
|
@ -253,7 +242,6 @@ class ArticleStatus(models.Model):
|
|||
status = models.CharField(max_length=2, choices=ARTICLE_STATUS_CHAR, blank=True, null=True)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Inventory(models.Model):
|
||||
barcode = models.PositiveIntegerField(unique=True)
|
||||
parent = models.ForeignKey('self', models.SET_NULL, to_field='barcode', blank=True, null=True)
|
||||
|
@ -292,7 +280,6 @@ class DerivedBook(Book, BookXtra):
|
|||
pass
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class ExplicitPK(models.Model):
|
||||
key = models.CharField(max_length=20, primary_key=True)
|
||||
desc = models.CharField(max_length=20, blank=True, unique=True)
|
||||
|
@ -304,7 +291,6 @@ class ExplicitPK(models.Model):
|
|||
return self.key
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Post(models.Model):
|
||||
title = models.CharField(max_length=50, unique_for_date='posted', blank=True)
|
||||
slug = models.CharField(max_length=50, unique_for_year='posted', blank=True)
|
||||
|
@ -315,7 +301,6 @@ class Post(models.Model):
|
|||
return self.title
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class DateTimePost(models.Model):
|
||||
title = models.CharField(max_length=50, unique_for_date='posted', blank=True)
|
||||
slug = models.CharField(max_length=50, unique_for_year='posted', blank=True)
|
||||
|
@ -330,7 +315,6 @@ class DerivedPost(Post):
|
|||
pass
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class BigInt(models.Model):
|
||||
biggie = models.BigIntegerField()
|
||||
|
||||
|
@ -363,7 +347,6 @@ class FlexibleDatePost(models.Model):
|
|||
posted = models.DateField(blank=True, null=True)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Colour(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue