mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +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
|
@ -5,7 +5,6 @@ import threading
|
|||
|
||||
from django.db import models
|
||||
from django.utils import six
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
|
||||
class DumbCategory(models.Model):
|
||||
|
@ -17,7 +16,6 @@ class ProxyCategory(DumbCategory):
|
|||
proxy = True
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class NamedCategory(DumbCategory):
|
||||
name = models.CharField(max_length=10)
|
||||
|
||||
|
@ -25,7 +23,6 @@ class NamedCategory(DumbCategory):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Tag(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
parent = models.ForeignKey(
|
||||
|
@ -43,7 +40,6 @@ class Tag(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Note(models.Model):
|
||||
note = models.CharField(max_length=100)
|
||||
misc = models.CharField(max_length=10)
|
||||
|
@ -63,7 +59,6 @@ class Note(models.Model):
|
|||
self.lock = threading.Lock()
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Annotation(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
tag = models.ForeignKey(Tag, models.CASCADE)
|
||||
|
@ -73,7 +68,6 @@ class Annotation(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class ExtraInfo(models.Model):
|
||||
info = models.CharField(max_length=100)
|
||||
note = models.ForeignKey(Note, models.CASCADE)
|
||||
|
@ -86,7 +80,6 @@ class ExtraInfo(models.Model):
|
|||
return self.info
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Author(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
num = models.IntegerField(unique=True)
|
||||
|
@ -99,7 +92,6 @@ class Author(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Item(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
created = models.DateTimeField()
|
||||
|
@ -115,7 +107,6 @@ class Item(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Report(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
creator = models.ForeignKey(Author, models.SET_NULL, to_field='num', null=True)
|
||||
|
@ -124,7 +115,6 @@ class Report(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Ranking(models.Model):
|
||||
rank = models.IntegerField()
|
||||
author = models.ForeignKey(Author, models.CASCADE)
|
||||
|
@ -137,7 +127,6 @@ class Ranking(models.Model):
|
|||
return '%d: %s' % (self.rank, self.author.name)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Cover(models.Model):
|
||||
title = models.CharField(max_length=50)
|
||||
item = models.ForeignKey(Item, models.CASCADE)
|
||||
|
@ -149,7 +138,6 @@ class Cover(models.Model):
|
|||
return self.title
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Number(models.Model):
|
||||
num = models.IntegerField()
|
||||
|
||||
|
@ -212,7 +200,6 @@ class CustomManager(models.Manager):
|
|||
return qs.filter(public=True, tag__name='t1')
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class ManagedModel(models.Model):
|
||||
data = models.CharField(max_length=10)
|
||||
tag = models.ForeignKey(Tag, models.CASCADE)
|
||||
|
@ -271,7 +258,6 @@ class CustomPkTag(models.Model):
|
|||
# path to another model, and a return path from that model.
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Celebrity(models.Model):
|
||||
name = models.CharField("Name", max_length=20)
|
||||
greatest_fan = models.ForeignKey("Fan", models.SET_NULL, null=True, unique=True)
|
||||
|
@ -290,7 +276,6 @@ class Fan(models.Model):
|
|||
# Multiple foreign keys
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class LeafA(models.Model):
|
||||
data = models.CharField(max_length=10)
|
||||
|
||||
|
@ -307,7 +292,6 @@ class Join(models.Model):
|
|||
b = models.ForeignKey(LeafB, models.CASCADE)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class ReservedName(models.Model):
|
||||
name = models.CharField(max_length=20)
|
||||
order = models.IntegerField()
|
||||
|
@ -318,7 +302,6 @@ class ReservedName(models.Model):
|
|||
# A simpler shared-foreign-key setup that can expose some problems.
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class SharedConnection(models.Model):
|
||||
data = models.CharField(max_length=10)
|
||||
|
||||
|
@ -336,7 +319,6 @@ class PointerB(models.Model):
|
|||
# Multi-layer ordering
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class SingleObject(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
|
||||
|
@ -355,7 +337,6 @@ class RelatedObject(models.Model):
|
|||
ordering = ['single']
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Plaything(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
others = models.ForeignKey(RelatedObject, models.SET_NULL, null=True)
|
||||
|
@ -367,7 +348,6 @@ class Plaything(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Article(models.Model):
|
||||
name = models.CharField(max_length=20)
|
||||
created = models.DateTimeField()
|
||||
|
@ -376,7 +356,6 @@ class Article(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Food(models.Model):
|
||||
name = models.CharField(max_length=20, unique=True)
|
||||
|
||||
|
@ -384,7 +363,6 @@ class Food(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Eaten(models.Model):
|
||||
food = models.ForeignKey(Food, models.SET_NULL, to_field="name", null=True)
|
||||
meal = models.CharField(max_length=20)
|
||||
|
@ -393,7 +371,6 @@ class Eaten(models.Model):
|
|||
return "%s at %s" % (self.food, self.meal)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Node(models.Model):
|
||||
num = models.IntegerField(unique=True)
|
||||
parent = models.ForeignKey("self", models.SET_NULL, to_field="num", null=True)
|
||||
|
@ -404,7 +381,6 @@ class Node(models.Model):
|
|||
# Bug #12252
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class ObjectA(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
|
||||
|
@ -425,7 +401,6 @@ class ChildObjectA(ObjectA):
|
|||
pass
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class ObjectB(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
objecta = models.ForeignKey(ObjectA, models.CASCADE)
|
||||
|
@ -440,7 +415,6 @@ class ProxyObjectB(ObjectB):
|
|||
proxy = True
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class ObjectC(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
objecta = models.ForeignKey(ObjectA, models.SET_NULL, null=True)
|
||||
|
@ -451,7 +425,6 @@ class ObjectC(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class SimpleCategory(models.Model):
|
||||
name = models.CharField(max_length=15)
|
||||
|
||||
|
@ -459,7 +432,6 @@ class SimpleCategory(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class SpecialCategory(SimpleCategory):
|
||||
special_name = models.CharField(max_length=15)
|
||||
|
||||
|
@ -467,7 +439,6 @@ class SpecialCategory(SimpleCategory):
|
|||
return self.name + " " + self.special_name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class CategoryItem(models.Model):
|
||||
category = models.ForeignKey(SimpleCategory, models.CASCADE)
|
||||
|
||||
|
@ -475,7 +446,6 @@ class CategoryItem(models.Model):
|
|||
return "category item: " + str(self.category)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class OneToOneCategory(models.Model):
|
||||
new_name = models.CharField(max_length=15)
|
||||
category = models.OneToOneField(SimpleCategory, models.CASCADE)
|
||||
|
@ -515,7 +485,6 @@ class ModelA(models.Model):
|
|||
d = models.ForeignKey(ModelD, models.CASCADE)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Job(models.Model):
|
||||
name = models.CharField(max_length=20, unique=True)
|
||||
|
||||
|
@ -528,7 +497,6 @@ class JobResponsibilities(models.Model):
|
|||
responsibility = models.ForeignKey('Responsibility', models.CASCADE, to_field='description')
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Responsibility(models.Model):
|
||||
description = models.CharField(max_length=20, unique=True)
|
||||
jobs = models.ManyToManyField(Job, through=JobResponsibilities,
|
||||
|
@ -561,7 +529,6 @@ class BaseA(models.Model):
|
|||
c = models.ForeignKey(FK3, models.SET_NULL, null=True)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Identifier(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
|
||||
|
@ -605,7 +572,6 @@ class MyObject(models.Model):
|
|||
# Models for #17600 regressions
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Order(models.Model):
|
||||
id = models.IntegerField(primary_key=True)
|
||||
|
||||
|
@ -616,7 +582,6 @@ class Order(models.Model):
|
|||
return '%s' % self.pk
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class OrderItem(models.Model):
|
||||
order = models.ForeignKey(Order, models.CASCADE, related_name='items')
|
||||
status = models.IntegerField()
|
||||
|
@ -632,7 +597,6 @@ class BaseUser(models.Model):
|
|||
pass
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Task(models.Model):
|
||||
title = models.CharField(max_length=10)
|
||||
owner = models.ForeignKey(BaseUser, models.CASCADE, related_name='owner')
|
||||
|
@ -642,7 +606,6 @@ class Task(models.Model):
|
|||
return self.title
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Staff(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
|
||||
|
@ -650,7 +613,6 @@ class Staff(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class StaffUser(BaseUser):
|
||||
staff = models.OneToOneField(Staff, models.CASCADE, related_name='user')
|
||||
|
||||
|
@ -673,7 +635,6 @@ class Person(models.Model):
|
|||
name = models.CharField(max_length=128)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Company(models.Model):
|
||||
name = models.CharField(max_length=128)
|
||||
employees = models.ManyToManyField(Person, related_name='employers', through='Employment')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue