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

Refs #23919 -- Removed python_2_unicode_compatible decorator usage

This commit is contained in:
Claude Paroz
2016-11-19 21:54:19 +01:00
parent d7b9aaa366
commit f3c43ad1fd
160 changed files with 23 additions and 757 deletions

View File

@@ -1,11 +1,9 @@
from datetime import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# M2M described on one of the models
@python_2_unicode_compatible
class Person(models.Model):
name = models.CharField(max_length=128)
@@ -16,7 +14,6 @@ class Person(models.Model):
return self.name
@python_2_unicode_compatible
class Group(models.Model):
name = models.CharField(max_length=128)
members = models.ManyToManyField(Person, through='Membership')
@@ -34,7 +31,6 @@ class Group(models.Model):
return self.name
@python_2_unicode_compatible
class Membership(models.Model):
person = models.ForeignKey(Person, models.CASCADE)
group = models.ForeignKey(Group, models.CASCADE)
@@ -48,7 +44,6 @@ class Membership(models.Model):
return "%s is a member of %s" % (self.person.name, self.group.name)
@python_2_unicode_compatible
class CustomMembership(models.Model):
person = models.ForeignKey(
Person,
@@ -74,7 +69,6 @@ class TestNoDefaultsOrNulls(models.Model):
nodefaultnonull = models.CharField(max_length=5)
@python_2_unicode_compatible
class PersonSelfRefM2M(models.Model):
name = models.CharField(max_length=5)
friends = models.ManyToManyField('self', through="Friendship", symmetrical=False)
@@ -90,7 +84,6 @@ class Friendship(models.Model):
# Custom through link fields
@python_2_unicode_compatible
class Event(models.Model):
title = models.CharField(max_length=50)
invitees = models.ManyToManyField(
@@ -110,7 +103,6 @@ class Invitation(models.Model):
invitee = models.ForeignKey(Person, models.CASCADE, related_name='invitations')
@python_2_unicode_compatible
class Employee(models.Model):
name = models.CharField(max_length=5)
subordinates = models.ManyToManyField(