thornomad / django-hitcount

Django hit counter application that tracks the number of hits/views for chosen objects
http://django-hitcount.rtfd.org
MIT License
463 stars 188 forks source link

"operator does not exist" Postgres 13 #102

Closed fortunto2 closed 3 years ago

fortunto2 commented 3 years ago

Hi, i change my postgres 10.5 to 13 version (to Google Cloud SQL).

Get error

operator does not exist: text = integer
LINE 1: ..._type_id" = 25 AND "hitcount_hit_count"."object_pk" = 53317)
                                                               ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.

when call in template

    <span class="card-buttons--info">{% get_hit_count for object %}</span>

full sql


ignored_wrapper_args | (False,  {'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7f37639e2650>,   'cursor': <django.db.backends.utils.CursorDebugWrapper object at 0x7f37233c2290>})
-- | --
params | (25, 53317)
self | <django.db.backends.utils.CursorDebugWrapper object at 0x7f37233c2290>
sql | ('SELECT "hitcount_hit_count"."id", "hitcount_hit_count"."hits", '  '"hitcount_hit_count"."modified", "hitcount_hit_count"."content_type_id", '  '"hitcount_hit_count"."object_pk" FROM "hitcount_hit_count" WHERE '  '("hitcount_hit_count"."content_type_id" = %s AND '  '"hitcount_hit_count"."object_pk" = %s)')

Django 2.2 Hitcount 1.3.3

Same https://github.com/thornomad/django-hitcount/issues/90

fortunto2 commented 3 years ago

Sorry... I update Hitcount from 1.2 to 1.3.3 and don't apply python manage.py migrate `