Commit af70dfcf authored by Florian Apolloner's avatar Florian Apolloner
Browse files

Reverted the introduction of shared_models.

The recent improvements should make shared_models obsolete.

This reverts commit 1059da8d, reversing
changes made to 4fa7f3cd.
parent f5d4849c
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -10,16 +10,29 @@ from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible

from shared_models.models import Author, Book

class Author(models.Model):
    name = models.CharField(max_length=100)
    class Meta:
        ordering = ('name', )

@python_2_unicode_compatible
class Article(models.Model):
    headline = models.CharField(max_length=100)
    pub_date = models.DateTimeField()
    author = models.ForeignKey(Author, blank=True, null=True)
    class Meta:
        ordering = ('-pub_date', 'headline')

    def __str__(self):
        return self.headline

class Tag(models.Model):
    articles = models.ManyToManyField(Book)
    articles = models.ManyToManyField(Article)
    name = models.CharField(max_length=100)
    class Meta:
        ordering = ('name', )


@python_2_unicode_compatible
class Season(models.Model):
    year = models.PositiveSmallIntegerField()
@@ -28,7 +41,6 @@ class Season(models.Model):
    def __str__(self):
        return six.text_type(self.year)


@python_2_unicode_compatible
class Game(models.Model):
    season = models.ForeignKey(Season, related_name='games')
@@ -38,7 +50,6 @@ class Game(models.Model):
    def __str__(self):
        return "%s at %s" % (self.away, self.home)


@python_2_unicode_compatible
class Player(models.Model):
    name = models.CharField(max_length=100)
+391 −394

File changed.

Preview size limit exceeded, changes collapsed.

+0 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ SUBDIRS_TO_SKIP = [
]

ALWAYS_INSTALLED_APPS = [
    'shared_models',
    'django.contrib.contenttypes',
    'django.contrib.auth',
    'django.contrib.sites',

tests/shared_models/__init__.py

deleted100644 → 0
+0 −0

Empty file deleted.

tests/shared_models/models.py

deleted100644 → 0
+0 −30
Original line number Diff line number Diff line
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible


class Tag(models.Model):
    name = models.CharField(max_length=255)


@python_2_unicode_compatible
class Author(models.Model):
    name = models.CharField(max_length=100)

    def __str__(self):
        return self.name


@python_2_unicode_compatible
class Book(models.Model):
    name = models.CharField(max_length=200)
    pages = models.IntegerField(default=0)
    author = models.ForeignKey(Author, null=True)
    pubdate = models.DateTimeField()
    tags = models.ManyToManyField(Tag)

    class Meta:
        ordering = ['-pubdate', 'name']

    def __str__(self):
        return self.name
Loading