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
|
@ -5,13 +5,11 @@ from django.contrib.contenttypes.fields import (
|
|||
)
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
|
||||
# Basic tests
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Author(models.Model):
|
||||
name = models.CharField(max_length=50, unique=True)
|
||||
first_book = models.ForeignKey('Book', models.CASCADE, related_name='first_time_authors')
|
||||
|
@ -38,7 +36,6 @@ class FavoriteAuthors(models.Model):
|
|||
ordering = ['id']
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class AuthorAddress(models.Model):
|
||||
author = models.ForeignKey(Author, models.CASCADE, to_field='name', related_name='addresses')
|
||||
address = models.TextField()
|
||||
|
@ -50,7 +47,6 @@ class AuthorAddress(models.Model):
|
|||
return self.address
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Book(models.Model):
|
||||
title = models.CharField(max_length=255)
|
||||
authors = models.ManyToManyField(Author, related_name='books')
|
||||
|
@ -74,7 +70,6 @@ class Bio(models.Model):
|
|||
books = models.ManyToManyField(Book, blank=True)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Reader(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
books_read = models.ManyToManyField(Book, related_name='read_by')
|
||||
|
@ -105,7 +100,6 @@ class TeacherManager(models.Manager):
|
|||
return super(TeacherManager, self).get_queryset().prefetch_related('qualifications')
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Teacher(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
qualifications = models.ManyToManyField(Qualification)
|
||||
|
@ -129,7 +123,6 @@ class Department(models.Model):
|
|||
|
||||
# GenericRelation/GenericForeignKey tests
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class TaggedItem(models.Model):
|
||||
tag = models.SlugField()
|
||||
content_type = models.ForeignKey(
|
||||
|
@ -230,7 +223,6 @@ class Person(models.Model):
|
|||
|
||||
# Models for nullable FK tests
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Employee(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
boss = models.ForeignKey('self', models.SET_NULL, null=True, related_name='serfs')
|
||||
|
@ -244,7 +236,6 @@ class Employee(models.Model):
|
|||
|
||||
# Ticket #19607
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class LessonEntry(models.Model):
|
||||
name1 = models.CharField(max_length=200)
|
||||
name2 = models.CharField(max_length=200)
|
||||
|
@ -253,7 +244,6 @@ class LessonEntry(models.Model):
|
|||
return "%s %s" % (self.name1, self.name2)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class WordEntry(models.Model):
|
||||
lesson_entry = models.ForeignKey(LessonEntry, models.CASCADE)
|
||||
name = models.CharField(max_length=200)
|
||||
|
@ -264,7 +254,6 @@ class WordEntry(models.Model):
|
|||
|
||||
# Ticket #21410: Regression when related_name="+"
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Author2(models.Model):
|
||||
name = models.CharField(max_length=50, unique=True)
|
||||
first_book = models.ForeignKey('Book', models.CASCADE, related_name='first_time_authors+')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue