{ "info": { "author": "Constantin Slednev", "author_email": "c.slednev@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Indexing/Search" ], "description": "django-statistic\n=========================\n\nStatistic for models\n\nInstall\n-------\n\nFor install you can use pip:\n```\npip install django-statistic\n```\n\nUsage\n-------\n\nmodels.py\n\n```\nfrom django.db import models\n\nclass Authors(models.Model):\n first_name = ....\n last_name = ....\n \nclass Books(models.Model):\n title = ....\n author = models.ManyToManyField(Author)\n```\n\nviews.py\n\n```\nfrom statistic import Statistic\nfrom models import Authors, Books\n\n\ndef my_view(request):\n book = Books.objects.get(...)\n\n # Put object in statistic table\n Statistic.objects.add(book)\n \n # Get statistic for object\n statistic_for_object = Statistic.objects.get_statistic_for_object(book)\n \n # Get statistic for model\n statistic_for_model = Statistic.objects.get_statistic_for_model(Books, limit=50)\n \n # Get statistic for models\n statistic_for_models = Statistic.objects.get_statistic_for_model([Authors, Books], limit=50, shuffle=True)\n```\n \nsettings.py\n\n```\nRELATIVE_FOR_YEAR = 1 # Get relative year (Today is 2013, example get: 2012, 2013)\nRELATIVE_FOR_MONTH = 3 # Get relative month (Today is 1'th January, example get: 2012.11, 2012.12, 2013.1)\nRELATIVE_FOR_WEEK = 2 # Get relative week (Today is 13'th week of year, example get: 11, 12, 13 week of year)\n```\n\nNote\n-------\n\nFor big data, you must use cache/crontab.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/unk2k/django-statistic", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-statistic", "package_url": "https://pypi.org/project/django-statistic/", "platform": "any", "project_url": "https://pypi.org/project/django-statistic/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/unk2k/django-statistic" }, "release_url": "https://pypi.org/project/django-statistic/1.0/", "requires_dist": null, "requires_python": null, "summary": "Statistic for django models", "version": "1.0" }, "last_serial": 849414, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "7f0e1b813b5eeefa695b532a7bee2f63", "sha256": "742461b95baec130e3a40ea66089e837e119b3892f5b5d4520daf9bbc9a295f1" }, "downloads": -1, "filename": "django-statistic-1.0.tar.gz", "has_sig": false, "md5_digest": "7f0e1b813b5eeefa695b532a7bee2f63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3868, "upload_time": "2013-08-26T15:45:34", "url": "https://files.pythonhosted.org/packages/c5/9f/98de702a0a4574a313042423308581b5bddeae850c6b3515f09fa76349f2/django-statistic-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7f0e1b813b5eeefa695b532a7bee2f63", "sha256": "742461b95baec130e3a40ea66089e837e119b3892f5b5d4520daf9bbc9a295f1" }, "downloads": -1, "filename": "django-statistic-1.0.tar.gz", "has_sig": false, "md5_digest": "7f0e1b813b5eeefa695b532a7bee2f63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3868, "upload_time": "2013-08-26T15:45:34", "url": "https://files.pythonhosted.org/packages/c5/9f/98de702a0a4574a313042423308581b5bddeae850c6b3515f09fa76349f2/django-statistic-1.0.tar.gz" } ] }