New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: invalid literal for int() with base 10 #64
Comments
Yea - I believe it’s locked into a integer primary key for the generic
relation at this point. I’m not sure if that was the only way to do it back
in the day or I just set it up that way knowingly but it’s still that way
now. You could fork it and change the generic relation setup to a TextField
and that should fix it.
…On Tue, Dec 26, 2017 at 1:48 AM Mihai Zamfir ***@***.***> wrote:
When my model has a pk that is a string, the call hit_count =
HitCount.objects.get_for_object(venue) fails with invalid literal for
int() with base 10: 'blablabla'
I suppose django hit count is not adapted to strings
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#64>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAHnLbWAXp7dS5Uuorv4q8BL-hQvLvPVks5tEMDtgaJpZM4RMpe->
.
|
@thornomad Thanks for your reply. I tried that but it seems that it's still not working. Something is breaking, not sure what... |
I had the same problem. I wrote |
@thornomad this one must be fixed (it was my mistake after all) |
Hi,
|
We are having the same problem with Postgres after upgrading to |
@macher91 @joshgeller can you try this: create function pg_catalog.text(int) returns text immutable language sql as $$select textin(int4out($1))$$;
create cast (int as text) with function pg_catalog.text(int) as implicit; |
When my model has a pk that is a string, the call
hit_count = HitCount.objects.get_for_object(obj)
fails withinvalid literal for int() with base 10: 'blablabla'
I suppose django hit count is not adapted to strings
The text was updated successfully, but these errors were encountered: