Comments (4)
same issue here. Can't get it work with drf, tried this way and few others also.
it's said that for method get_for_object you should pass model object - i assume it's an instance?
tried also something like
hit_count = HitCount.objects.get_for_object(Artigo.objects.first())
but in this case other error occurs
django.db.utils.OperationalError: no such table: hitcount_hit_count
from django-hitcount.
You should pass the actual model instance
, not model itself.
from django-hitcount.
You should pass the actual model instance, not model itself.
correct!
from django-hitcount.
I've also tried doing class Artigo(models.Model, HitCountMixin): but then when I try to makemigrations I get No changes detected
see https://github.com/thornomad/django-hitcount/blob/develop/hitcount/models.py#L181, there nothing except hit_count
method
from django-hitcount.
Related Issues (20)
- "operator does not exist" Postgres 13 HOT 1
- how to write fixture
- Only getting 10.0.0.1 when connecting via IPv6
- Django version 3 support? HOT 1
- Doesn't work with Django 3.1.3 HOT 2
- Would you like to add maintainers to the current project HOT 2
- Save by date feature HOT 1
- no such table: hitcount_blacklist_ip HOT 3
- Django 4.x: import of gettext failing HOT 5
- ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' HOT 3
- BUG: hitcount_cleanup not working for big dataset
- Support for project with multiple Site ID
- Issue when running "python manage.py migrate --fake-initial". Resetting migrations HOT 1
- Delete hits from admin panel
- How to use it in Django REST framework? HOT 2
- Does not work with Django 3.2.5 HOT 11
- Making request using JavaScript, hits is incrementing every request + 1
- Differentiate between bot and real user
- making the object_pk use uuid throws ProgrammingError error.
- Allow to search for pagetitle in admin interface
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-hitcount.