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

@ -12,7 +12,6 @@ Model inheritance exists in two varieties:
Both styles are demonstrated here.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
#
@ -20,7 +19,6 @@ from django.utils.encoding import python_2_unicode_compatible
#
@python_2_unicode_compatible
class CommonInfo(models.Model):
name = models.CharField(max_length=50)
age = models.PositiveIntegerField()
@ -52,7 +50,6 @@ class Post(models.Model):
title = models.CharField(max_length=50)
@python_2_unicode_compatible
class Attachment(models.Model):
post = models.ForeignKey(
Post,
@ -81,7 +78,6 @@ class Link(Attachment):
# Multi-table inheritance
#
@python_2_unicode_compatible
class Chef(models.Model):
name = models.CharField(max_length=50)
@ -89,7 +85,6 @@ class Chef(models.Model):
return "%s the chef" % self.name
@python_2_unicode_compatible
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
@ -106,7 +101,6 @@ class Rating(models.Model):
ordering = ['-rating']
@python_2_unicode_compatible
class Restaurant(Place, Rating):
serves_hot_dogs = models.BooleanField(default=False)
serves_pizza = models.BooleanField(default=False)
@ -119,7 +113,6 @@ class Restaurant(Place, Rating):
return "%s the restaurant" % self.name
@python_2_unicode_compatible
class ItalianRestaurant(Restaurant):
serves_gnocchi = models.BooleanField(default=False)
@ -127,7 +120,6 @@ class ItalianRestaurant(Restaurant):
return "%s the italian restaurant" % self.name
@python_2_unicode_compatible
class Supplier(Place):
customers = models.ManyToManyField(Restaurant, related_name='provider')
@ -135,7 +127,6 @@ class Supplier(Place):
return "%s the supplier" % self.name
@python_2_unicode_compatible
class ParkingLot(Place):
# An explicit link to the parent (we can control the attribute name).
parent = models.OneToOneField(Place, models.CASCADE, primary_key=True, parent_link=True)