{ "info": { "author": "Yohann Gabory", "author_email": "boblefrag@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "Badges are earned by users for meeting some `conditions` defined\nin the badge.json file\n\nA Badge object (database model) is then created linking a user to a badge.\n\nconditions\n----------\n\nCondition is a sql check to be made for awarding a badge.\n\nYou have access to the variable NEW if you set the `trigger_contition`\nto \"update\" or \"insert\". This is the database object after update or insert.\n\nYou have access to the variable OLD if you set the `trigger_contition`\nto \"update\" or \"delete\". This is the database object after update or delete.\n\n\ntriggers\n--------\n\nWe want the badges to be given as soon as a condition is meet. Even if\nthe event come from an event outside the Django application.\n\nWe do not want to relly on celery to periodicaly check for badges\n\n- Too often : this is a performance bootleneck\n- Too late : annoying for users\n\nThe check for each badge is checked when \"something\" change.\n\nTo create the database triggers that will be responsible for badge earning run:\n\n>>> python manage.py create_badge_triggers\n\nWhen you change `badge.json` (adding, updating or deleting badges) run this commande to reflect those changes in the database.\n\nbadge.json example\n------------------\n```\n[{\"name\": \"Pionner\",\n\"code\": \"pionner\",\n\"condition\": \"age(NEW.date_joined) > interval '1 year'\",\n\"trigger_condition\": \"update\",\n\"trigger_table\": \"auth_user\",\n\"user_field\": \"id\"\n},\n{\"name\": \"Collector\",\n\"code\": \"collector\"\n\"condition\": \"count(id) >= 5 from dummy_sketch where user_id = NEW.user_id\",\n\"trigger_condition\": \"insert\",\n\"trigger_table\": \"dummy_sketch\",\n\"user_field\": \"user_id\"\n},\n{\"name\": \"Star\",\n\"code\": \"star\",\n\"condition\": \"hit_views > 1000 \",\n\"trigger_condition\": \"update\",\n\"trigger_table\": \"dummy_sketch\",\n\"user_field\": \"user_id\"\n}]\n```\n`name` is the name of the badge as it will be displayed in the front or the API.\n\n`code` is th unique code name of the badge\n\n`condition` is the query that will be issued to check if the badge\nshould be earned\n\n`trigger_contition` tell when the check must be made. One of insert,\nupdate or delete\n\nINSTALL\n=======\n\nsee `INSTALL` file for instructions.", "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/boblefrag/django-pg-badges", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "django-pg-badges", "package_url": "https://pypi.org/project/django-pg-badges/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-pg-badges/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/boblefrag/django-pg-badges" }, "release_url": "https://pypi.org/project/django-pg-badges/0.1/", "requires_dist": null, "requires_python": null, "summary": "Create badge for your django user with postgresql triggers", "version": "0.1" }, "last_serial": 1920811, "releases": { "0.1": [ { "comment_text": "built for Linux-3.16.0-4-amd64-x86_64-with-glibc2.4", "digests": { "md5": "69a9e8f96b34b84e880e81028f4f2150", "sha256": "a0fd0cf3e69959cf3462388f4d3608b5ec83bda55fe9c9ffacd67147ac9b0af7" }, "downloads": -1, "filename": "django-pg-badges-0.1.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "69a9e8f96b34b84e880e81028f4f2150", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 11039, "upload_time": "2016-01-24T23:35:11", "url": "https://files.pythonhosted.org/packages/6e/9d/b38f2bbf8d988da316c177d83e765d2969c9530eb6042d7dfe708cace472/django-pg-badges-0.1.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "432abca3b65e7a1df798f495f429f42b", "sha256": "7f92f8a8ebfdff42e1e39433ffc844c4d46360de48c0f41f31c0e54e85b13204" }, "downloads": -1, "filename": "django-pg-badges-0.1.tar.gz", "has_sig": false, "md5_digest": "432abca3b65e7a1df798f495f429f42b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6241, "upload_time": "2016-01-24T23:35:05", "url": "https://files.pythonhosted.org/packages/1f/9a/70cebf1594a84db0b697c2ae4dc5aa16a6c24184b57eee165de5af1b145f/django-pg-badges-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "built for Linux-3.16.0-4-amd64-x86_64-with-glibc2.4", "digests": { "md5": "69a9e8f96b34b84e880e81028f4f2150", "sha256": "a0fd0cf3e69959cf3462388f4d3608b5ec83bda55fe9c9ffacd67147ac9b0af7" }, "downloads": -1, "filename": "django-pg-badges-0.1.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "69a9e8f96b34b84e880e81028f4f2150", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 11039, "upload_time": "2016-01-24T23:35:11", "url": "https://files.pythonhosted.org/packages/6e/9d/b38f2bbf8d988da316c177d83e765d2969c9530eb6042d7dfe708cace472/django-pg-badges-0.1.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "432abca3b65e7a1df798f495f429f42b", "sha256": "7f92f8a8ebfdff42e1e39433ffc844c4d46360de48c0f41f31c0e54e85b13204" }, "downloads": -1, "filename": "django-pg-badges-0.1.tar.gz", "has_sig": false, "md5_digest": "432abca3b65e7a1df798f495f429f42b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6241, "upload_time": "2016-01-24T23:35:05", "url": "https://files.pythonhosted.org/packages/1f/9a/70cebf1594a84db0b697c2ae4dc5aa16a6c24184b57eee165de5af1b145f/django-pg-badges-0.1.tar.gz" } ] }