django-vote
django-vote copied to clipboard
Questions on Vote_vote db and user_id part
Hi,
I am a newbie in Django, and I have struggled with two problems. The first issue seems to be related to the user_id section. Every time I try to run python manage.py runserver, I face an error message as follows: "ValueError at /feedback/display/up/ invalid literal for int() with base 10: '12345a1dd12345555a0a55" <--- this is a random string to deidentify the id info, but basically you can see it is a mixture of numbers and alphabets, which are not int() at all. How should I change the user_id section to include not only ints but also strings?
The second issue popped up after I put random numbers instead of the strings in the user_id section. An error message I've got is as follows :ProgrammingError at /feedback/display/up/ (1146, "Table 'mydb.vote_vote' doesn't exist"). Should there be a db table called vote_vote in my database? Should I create one or it should've been there once I install django-vote?
Thanks!
This is my view.py
def feedback_display (request) :
if request.GET.get("vote-up"):
thumbsup_1 = PeerFeedback.objects.get(reviewee_user_id=given_user_id, reviewer_user_id=reviewer_user_id_1)
thumbsup_1.votes.up(request.session['lti_launch_params']['user_id'])
return redirect("polls/feedback_display.html", {'thumbsup_1': thumbsup_1})
First question, currently we don't support string user id, if you really want string user id, you have to fork and change the field type.
Second, you have to run ./manage.py migrate to create vote_vote in db.