Skip to content Skip to sidebar Skip to footer

Invalid Literal For Int() With Base 10: 'aa',,i'm Not Trying To Pass Number Why Am I Getting This?

Hello I'm django activity stream, and I got this error: invalid literal for int() with base 10 when I tried to follow category named aa. This is my code def category_timeline(reque

Solution 1:

Posting the final conclusion from above discussion

in this call User.objects.get(category=category)) it is expecting primary key of Category model instead of a string.

So something like following should work

category_id = Category.objects.get(name=category)
User.objects.get(category=category_id))

Post a Comment for "Invalid Literal For Int() With Base 10: 'aa',,i'm Not Trying To Pass Number Why Am I Getting This?"