Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated to handle move of generic relations in Django revision 5172

git-svn-id: https://django-voting.googlecode.com/svn/trunk@45 662f01ad-f42a-0410-a340-718c64ddaef4
  • Loading branch information...
commit 29b56c5ae5fbff3af8a34a61e9a54f9163a6bf09 1 parent a6a14fd
Jonathan Buchanan authored May 16, 2007

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. 8  models.py
8  models.py
@@ -2,6 +2,12 @@
2 2
 from django.contrib.contenttypes.models import ContentType
3 3
 from django.contrib.auth.models import User
4 4
 
  5
+# Generic relations were moved in Django revision 5172
  6
+try:
  7
+    from django.contrib.contenttypes import generic
  8
+except ImportError:
  9
+    import django.db.models as generic
  10
+
5 11
 class VoteManager(models.Manager):
6 12
     def get_score(self, obj):
7 13
         """
@@ -138,7 +144,7 @@ class Vote(models.Model):
138 144
     user = models.ForeignKey(User)
139 145
     content_type = models.ForeignKey(ContentType)
140 146
     object_id = models.PositiveIntegerField()
141  
-    object = models.GenericForeignKey('content_type', 'object_id')
  147
+    object = generic.GenericForeignKey('content_type', 'object_id')
142 148
     vote = models.SmallIntegerField(choices=SCORES)
143 149
 
144 150
     objects = VoteManager()

0 notes on commit 29b56c5

Please sign in to comment.
Something went wrong with that request. Please try again.