# 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.
Raw data
{
"_id": null,
"home_page": "",
"name": "django-db-counter",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "django,django model extensions",
"author": "zencore",
"author_email": "dobetter@zencore.cn",
"download_url": "https://files.pythonhosted.org/packages/71/02/17d3a900b23475a18e16d80f1e8189c5fcd09fcf732ceed80e756d53496e/django-db-counter-0.1.0.tar.gz",
"platform": null,
"description": "# django-db-counter\n\nObtain continuous count.\n\n## Install\n\n```\npip install django-db-counter\n```\n\n## Use a shared table to count\n\n```\nfrom django_db_counter.models import DjangoDBCounter\n\n\nsome_id = DjangoDBCounter.get_next(\"some_keyword\")\n```\n\n## Use a dedicated table to count\n\n*app/models.py*\n\n```\nfrom django_db_counter.models import DjangoDBCounterBase\n\nclass MyCounter(DjangoDBCounterBase):\n default_key = \"my_counter_keyword\" # default to \"default\"\n```\n\n*app/views.py*\n\n```\nfrom app.models import MyCounter\n\nsome_id = MyCounter.get_next()\n```\n\n\n## Releases\n\n### v0.1.0\n\n- First release.\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Obtain continuous count.",
"version": "0.1.0",
"split_keywords": [
"django",
"django model extensions"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "cf8d15a65c2b923268c4e29ecea69e69",
"sha256": "5c1dd8437e619800299223e67a661dfcec9f5ffba4f6675dc4279b206aefb3ef"
},
"downloads": -1,
"filename": "django_db_counter-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cf8d15a65c2b923268c4e29ecea69e69",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6688,
"upload_time": "2022-12-21T03:34:01",
"upload_time_iso_8601": "2022-12-21T03:34:01.951407Z",
"url": "https://files.pythonhosted.org/packages/50/f5/8b1a2d52bf4d9e5c0b622dc700b4e1edcdf80def58a0a57240c75bb33078/django_db_counter-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "ced000a784c1209325818b3002aa143f",
"sha256": "c860790e87dd00e0256b5305439d643f0c7bab4b3351455939cb6b857557acf9"
},
"downloads": -1,
"filename": "django-db-counter-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "ced000a784c1209325818b3002aa143f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5454,
"upload_time": "2022-12-21T03:34:03",
"upload_time_iso_8601": "2022-12-21T03:34:03.922039Z",
"url": "https://files.pythonhosted.org/packages/71/02/17d3a900b23475a18e16d80f1e8189c5fcd09fcf732ceed80e756d53496e/django-db-counter-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-21 03:34:03",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "django-db-counter"
}