dcramer / django-ratings

Pluggable rating fields in Django.
BSD 2-Clause "Simplified" License
407 stars 167 forks source link

Problem if my id key is not integer #14

Open ghost opened 14 years ago

ghost commented 14 years ago

My models all extend my custom model class which id is a CharField not a PositiveIntegerField like the Django's default django.db.models.Model . So, when I try to add a vote, the code will fail at:

rating, created = Vote.objects.get(**kwargs), False

in fields.py because of the object_id field being defined like this in models.py:

object_id       = models.PositiveIntegerField()

Any ideas how should I deal with this ?

Thanks in advance

dengyuanzhong commented 13 years ago

I have the same problem!

gakhov commented 13 years ago

I have the same problem, since my PrimaryKey is a SlugField.