Skip to content

Commit

Permalink
Simplify ForeignKey to user with django new standards
Browse files Browse the repository at this point in the history
Linked #28
  • Loading branch information
arthur-wsw committed Feb 21, 2016
1 parent 8146ac0 commit c0c0637
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pinax/ratings/models.py
Expand Up @@ -6,7 +6,6 @@
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible

from django.contrib.auth.models import User
try:
from django.contrib.contenttypes.fields import GenericForeignKey
except:
Expand All @@ -16,8 +15,6 @@
from .categories import RATING_CATEGORY_CHOICES
from .managers import OverallRatingManager

USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', User)


class OverallRating(models.Model):

Expand Down Expand Up @@ -46,7 +43,7 @@ class Rating(models.Model):
object_id = models.IntegerField(db_index=True)
content_type = models.ForeignKey(ContentType)
content_object = GenericForeignKey()
user = models.ForeignKey(USER_MODEL)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
rating = models.IntegerField()
timestamp = models.DateTimeField(default=timezone.now)
category = models.IntegerField(null=True, choices=RATING_CATEGORY_CHOICES)
Expand Down

0 comments on commit c0c0637

Please sign in to comment.