Skip to main content

Obtain continuous count.

Project description

django-db-counter

Obtain continuous count.

Install

pip install django-db-counter

Use a shared table to count

from django_db_counter.models import DjangoDBCounter


some_id = DjangoDBCounter.get_next("some_keyword")

Use a dedicated table to count

app/models.py

from django_db_counter.models import DjangoDBCounterBase

class MyCounter(DjangoDBCounterBase):
    default_key = "my_counter_keyword" # default to "default"

app/views.py

from app.models import MyCounter

some_id = MyCounter.get_next()

Releases

v0.1.0

  • First release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-db-counter-0.1.0.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

django_db_counter-0.1.0-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page