{ "info": { "author": "Nicolas Dubois", "author_email": "nicolas.c.dubois@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "==============================\nDjango: Basic Models Behaviors\n==============================\n\n.. image:: https://img.shields.io/pypi/v/django-basic-models-behaviors.svg\n :target: https://pypi.python.org/pypi/django-basic-models-behaviors/\n :alt: Latest Version on PyPI\n\n.. image:: https://img.shields.io/pypi/pyversions/django-basic-models-behaviors.svg\n :target: https://pypi.python.org/pypi/django-basic-models-behaviors/\n :alt: Supported Python versions\n\n.. image:: https://img.shields.io/travis/wo0dyn/django-basic-models-behaviors.svg\n :target: https://travis-ci.org/wo0dyn/django-basic-models-behaviors\n :alt: TravisCI status\n\nTiny app to provide basic behaviors for django models, like:\n\n* Timestampable\n* Publishable\n* SoftDeletable\n* Cacheable\n\nInstallation\n------------\n\nFrom PyPI::\n\n $ pip install django-basic-models-behaviors\n\nUsage\n-----\n\nPublishableModel\n~~~~~~~~~~~~~~~~\n\nHere is an example of Article using *PublishableModel*:\n\n.. code-block:: python\n\n from basic_models_behaviors import models as behaviors\n from django.db import models\n\n class Article(behaviors.PublishableModel):\n title = models.CharField(max_length=255)\n contents = models.TextField()\n\nThen:\n\n.. code-block:: python\n\n >>> article = Article(title='Foo', contents='Lorem lipsum')\n >>> article.publish()\n >>> article.is_published()\n True\n >>> article.unpublish()\n >>> article.is_published()\n False\n >>> article.is_not_published()\n True\n\n\nSoftDeletableModel\n~~~~~~~~~~~~~~~~~~\n\nSoftDeletableModel behavior will add deleted_at field in set the current\ntimestamp instead of delete the object.\nforce_delete() will actually delete the model.\n\nIn your models.py:\n\n.. code-block:: python\n\n from basic_models_behaviors import models as behaviors\n from django.db import models\n\n class Article(behaviors.SoftDeletableModel):\n title = models.CharField(max_length=255)\n contents = models.TextField()\n\nThen:\n\n.. code-block:: python\n\n >>> from models import Article\n >>> article = Article(title='foo', contents='Lorem lipsum')\n >>> article.delete()\n >>> article.has_been_deleted()\n True\n >>> article.undelete()\n >>> article.has_been_deleted()\n False\n >>> article.force_delete()\n\nTests\n-----\n\nRun tests::\n\n $ pip install -r tests/requirements.txt\n $ py.test --ds=tests.settings tests\n\nAuthors\n-------\n\n* `@wo0dyn `_ \u2022 Nicolas Dubois ", "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/wo0dyn/django-basic-models-behaviors", "keywords": "django", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "django-basic-models-behaviors", "package_url": "https://pypi.org/project/django-basic-models-behaviors/", "platform": "any", "project_url": "https://pypi.org/project/django-basic-models-behaviors/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/wo0dyn/django-basic-models-behaviors" }, "release_url": "https://pypi.org/project/django-basic-models-behaviors/0.6.0/", "requires_dist": null, "requires_python": null, "summary": "Tiny app to provide basic behaviors for django models.", "version": "0.6.0" }, "last_serial": 2023491, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "d95a1e96adc0d4d1cf5ab43ee9958cd7", "sha256": "b2fc7579b70fe19ccd84ce551b3c7a4a1a20fd909487871247f0e6492afda162" }, "downloads": -1, "filename": "django-basic-models-behaviors-0.5.0.tar.gz", "has_sig": false, "md5_digest": "d95a1e96adc0d4d1cf5ab43ee9958cd7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7939, "upload_time": "2013-10-23T08:36:21", "url": "https://files.pythonhosted.org/packages/ee/72/2d33ba701067fe2e8d5a16f5ed40d1223e6c7b53ea851e13f3b0daf117de/django-basic-models-behaviors-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "ae68ad57ff615cbe8b4ede72245ae0d9", "sha256": "61ebe71c48c6e85d01ceb2b0b6d9e59baea97d1508c9f5f7103ce087384047ef" }, "downloads": -1, "filename": "django-basic-models-behaviors-0.6.0.tar.gz", "has_sig": false, "md5_digest": "ae68ad57ff615cbe8b4ede72245ae0d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7395, "upload_time": "2016-03-22T23:07:35", "url": "https://files.pythonhosted.org/packages/7b/65/a0d83bd0a36ffa9203697c312b6624abb5383dabf7635284d7c8fb5f0cba/django-basic-models-behaviors-0.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ae68ad57ff615cbe8b4ede72245ae0d9", "sha256": "61ebe71c48c6e85d01ceb2b0b6d9e59baea97d1508c9f5f7103ce087384047ef" }, "downloads": -1, "filename": "django-basic-models-behaviors-0.6.0.tar.gz", "has_sig": false, "md5_digest": "ae68ad57ff615cbe8b4ede72245ae0d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7395, "upload_time": "2016-03-22T23:07:35", "url": "https://files.pythonhosted.org/packages/7b/65/a0d83bd0a36ffa9203697c312b6624abb5383dabf7635284d7c8fb5f0cba/django-basic-models-behaviors-0.6.0.tar.gz" } ] }