mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
@@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Tag(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
@@ -15,6 +16,7 @@ class Tag(models.Model):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Celebrity(models.Model):
|
||||
name = models.CharField("Name", max_length=20)
|
||||
@@ -23,9 +25,11 @@ class Celebrity(models.Model):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Fan(models.Model):
|
||||
fan_of = models.ForeignKey(Celebrity)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Staff(models.Model):
|
||||
id = models.IntegerField(primary_key=True)
|
||||
@@ -37,6 +41,7 @@ class Staff(models.Model):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class StaffTag(models.Model):
|
||||
staff = models.ForeignKey(Staff)
|
||||
|
||||
Reference in New Issue
Block a user