shellfly / django-vote

Simple vote for django
http://django-vote.readthedocs.io
Apache License 2.0
158 stars 49 forks source link

user id as UUID #44

Closed murdav closed 7 years ago

murdav commented 7 years ago

Dear Author,

We are thinking to use user ID as a UUID.

Example:

from django.contrib.auth.models import AbstractUser
class MyUser(AbstractUser):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)

While in the Vote model we have the bigint field.

Do you think it's accetable to change user_id = models.BigIntegerField() to user = models.ForeignKey(settings.AUTH_USER_MODEL,

as suggested here.

Thanks so much,

D

shellfly commented 7 years ago

When you separate your User service from other code, you can only get the user_id in many cases. So we use a user_id instead of a ForeignKey to do this. If you want to use a UUID user_id, you can fork this repo and do some change to implement it.

murdav commented 7 years ago

Thanks for replying, that is what I did.

D