Permalink
Browse files

Reverted the introduction of shared_models.

The recent improvements should make shared_models obsolete.

This reverts commit 1059da8, reversing
changes made to 4fa7f3c.
  • Loading branch information...
1 parent f5d4849 commit af70dfcf317fd045df69917baca7bc0c58e2fd32 @apollo13 apollo13 committed Jun 10, 2013
@@ -10,16 +10,29 @@
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)
Oops, something went wrong.

0 comments on commit af70dfc

Please sign in to comment.