{ "info": { "author": "Jo\u00e3o Sampaio", "author_email": "jpmelos@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3 :: Only" ], "description": "=======\ndjango-generic-models\n=======\n\n.. image:: https://travis-ci.org/jpmelos/django-generic-models.svg?branch=master\n :target: https://travis-ci.org/jpmelos/django-generic-models\n\ndjango-generic-models provides subclassed models with a clearer API for fetching superclasses, subclasses and making comparison.\n\nSupports:\n\n* Python 3.4, 3.5 and 3.6.\n* Django 1.8, 1.9, 1.10, 1.11 and 2.0.\n\n------------\nInstallation\n------------\n\n::\n\n $ pip install django-generic-models\n\n-----------\nBasic usage\n-----------\n\nDeclare the superclass as a subclass of ``TypedModel``::\n\n from genericmodels.models import TypedModel\n\n class Animal(TypedModel):\n name = CharField(max_length=30)\n\n def say_something(self):\n raise NotImplementedError\n\n\nThen, declare the subclasses as usual::\n\n from django.db.models import CharField\n\n class Cat(Animal):\n color = CharField(max_length=30)\n\n def say_something(self):\n return 'meow'\n\nYou'll be able to get the specific instance of ``Animal`` or the generic instance of ``Cat`` very easily with::\n\n cat = Cat()\n animal = cat.generic\n cat = animal.specific\n\nComparison also works::\n\n >>> print(cat == animal)\n True\n\nEven though they are not the same object in memory, and one is a ``Cat`` instance and the other is an ``Animal`` instance, they are still the same object, semantically.\n\nFor an example of working code, check the ``test_app``.\n\n-----------\nDevelopment\n-----------\n\nInstall for development and with dependencies::\n\n $ pip install -e .[dev]\n\nAsserting code quality\n^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n $ python dev.py quality\n\n\nRunning the tests\n^^^^^^^^^^^^^^^^^\n\nTo run the tests, use::\n\n $ python dev.py test\n\nTo run the tests with ``tox``::\n\n $ tox\n\nPackaging for PyPI distribution\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n $ python dev.py package\n\nThe build will happen if the repository is clean: no untracked files are found. If not, you can see what's wrong with ``git clean -dfx --dry-run`` and remove or track and commit those files.\n\nBuilds will be available at ``dist``, in wheel and source.\n\n----------\nContribute\n----------\n\nPull requests are welcome.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jpmelos/django-generic-models", "keywords": "multi-table inheritance,django,subclass,superclass", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-generic-models", "package_url": "https://pypi.org/project/django-generic-models/", "platform": "", "project_url": "https://pypi.org/project/django-generic-models/", "project_urls": { "Homepage": "http://github.com/jpmelos/django-generic-models" }, "release_url": "https://pypi.org/project/django-generic-models/0.3/", "requires_dist": [ "Django (==2.0.4)", "pytz (==2018.4)", "certifi (==2018.4.16); extra == 'dev'", "chardet (==3.0.4); extra == 'dev'", "coverage (==4.5.1); extra == 'dev'", "idna (==2.6); extra == 'dev'", "isort (==4.3.4); extra == 'dev'", "pep8 (==1.7.1); extra == 'dev'", "pkginfo (==1.4.2); extra == 'dev'", "pluggy (==0.6.0); extra == 'dev'", "py (==1.5.3); extra == 'dev'", "pyflakes (==1.6.0); extra == 'dev'", "requests (==2.18.4); extra == 'dev'", "requests-toolbelt (==0.8.0); extra == 'dev'", "six (==1.11.0); extra == 'dev'", "subcomm (==0.3.2); extra == 'dev'", "tox (==3.0.0); extra == 'dev'", "tqdm (==4.23.0); extra == 'dev'", "twine (==1.11.0); extra == 'dev'", "urllib3 (==1.22); extra == 'dev'", "virtualenv (==15.2.0); extra == 'dev'" ], "requires_python": ">=3.4, <3.7", "summary": "django-generic-models provides subclassed models with a clear API for fetching superclasses, subclasses and making comparison.", "version": "0.3" }, "last_serial": 3790366, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "c95046f31b43cf88b181ba3ca7351d67", "sha256": "bb862b3516d80aeaffd1671cca74e31a3461ed700dd72fb1e0077a564f103d23" }, "downloads": -1, "filename": "django_generic_models-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c95046f31b43cf88b181ba3ca7351d67", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7178, "upload_time": "2016-11-08T17:00:09", "url": "https://files.pythonhosted.org/packages/a7/51/7656f4472ab23ab1d78a8e5e264ac31e954d84f712b171092c6c67ee352d/django_generic_models-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "afd9123ef00fb627bb4dba7ec735c04d", "sha256": "a7fc53633c57ad0debc69abd07364ee3ed381c31f29f2211aa9a43d821062775" }, "downloads": -1, "filename": "django-generic-models-0.1.tar.gz", "has_sig": false, "md5_digest": "afd9123ef00fb627bb4dba7ec735c04d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4661, "upload_time": "2016-11-08T17:00:11", "url": "https://files.pythonhosted.org/packages/90/1e/5104ef1b501726ee85b0c436028f9a4b9b35860e7062e916d54cdaaba1be/django-generic-models-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "39c5eb576a4cc26c2e17de36f159c5f9", "sha256": "f865e119342064b64870512f73b872782725cfa427c59094f8cc050c79a460e1" }, "downloads": -1, "filename": "django_generic_models-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "39c5eb576a4cc26c2e17de36f159c5f9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7714, "upload_time": "2016-11-09T13:31:12", "url": "https://files.pythonhosted.org/packages/b0/13/fde171c829bbc7e97c8eebbd4126e1eb6c9ee5a2bb954d9e2dabfc38a451/django_generic_models-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "212b9c7f7ff59318afe8263cd42d1e72", "sha256": "57ed6395be2dd20e3e779581a89c2b013433ba8888ccc319e72a9fc38c19a393" }, "downloads": -1, "filename": "django-generic-models-0.1.1.tar.gz", "has_sig": false, "md5_digest": "212b9c7f7ff59318afe8263cd42d1e72", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4953, "upload_time": "2016-11-09T13:31:15", "url": "https://files.pythonhosted.org/packages/5d/75/ce1dc3ad61d2537c85f544c63d790e60d6e3f6f70da1d55a4ef242bcae6d/django-generic-models-0.1.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "6b39a2377e45f570dc5e5decb1f4597a", "sha256": "581a3f61d402c5b42504b439b093ff6b4a4c3f23fd257fe596c3b6e106c938ef" }, "downloads": -1, "filename": "django_generic_models-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "6b39a2377e45f570dc5e5decb1f4597a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7535, "upload_time": "2017-03-26T00:04:41", "url": "https://files.pythonhosted.org/packages/82/f1/3ed446f2599866306504ea06044ba1b45af46a0a9cb98aefe2abea622aab/django_generic_models-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6d17001a0950162ea04038a8d53b834f", "sha256": "4c3da42812f09a3d17f462d63336c44ba22b28f3cbcce3b642668d7b301c03a2" }, "downloads": -1, "filename": "django-generic-models-0.2.tar.gz", "has_sig": false, "md5_digest": "6d17001a0950162ea04038a8d53b834f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4878, "upload_time": "2017-03-26T00:04:43", "url": "https://files.pythonhosted.org/packages/bf/5d/32d43fe3dd568c6f886b2069ae640114379051940a6d303fc976c5b11fe2/django-generic-models-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "a80094edbfd711cf2f246ea3f97dc256", "sha256": "3d6f08800b143a7eacae46d3b5dd9093f858bd79056a2d27eee6c20b2c1a82a4" }, "downloads": -1, "filename": "django_generic_models-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "a80094edbfd711cf2f246ea3f97dc256", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4, <3.7", "size": 5911, "upload_time": "2018-04-23T00:04:08", "url": "https://files.pythonhosted.org/packages/16/e4/865f4863476e97672bbf6c02ee0f594401f50b24c89093ee8146fb664e29/django_generic_models-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d06dc9f7e6648eb053376ed4fd9c25a6", "sha256": "85740e54e0e573a5a4f540d9c4b8bbe749396b6feb6ac1d4e08dfcd96a766198" }, "downloads": -1, "filename": "django-generic-models-0.3.tar.gz", "has_sig": false, "md5_digest": "d06dc9f7e6648eb053376ed4fd9c25a6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, <3.7", "size": 5373, "upload_time": "2018-04-23T00:04:10", "url": "https://files.pythonhosted.org/packages/a9/ff/6ab972255677d3c4aea1ad525a8d9a5f5d4a46cb95e614892d925ba326c5/django-generic-models-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a80094edbfd711cf2f246ea3f97dc256", "sha256": "3d6f08800b143a7eacae46d3b5dd9093f858bd79056a2d27eee6c20b2c1a82a4" }, "downloads": -1, "filename": "django_generic_models-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "a80094edbfd711cf2f246ea3f97dc256", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4, <3.7", "size": 5911, "upload_time": "2018-04-23T00:04:08", "url": "https://files.pythonhosted.org/packages/16/e4/865f4863476e97672bbf6c02ee0f594401f50b24c89093ee8146fb664e29/django_generic_models-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d06dc9f7e6648eb053376ed4fd9c25a6", "sha256": "85740e54e0e573a5a4f540d9c4b8bbe749396b6feb6ac1d4e08dfcd96a766198" }, "downloads": -1, "filename": "django-generic-models-0.3.tar.gz", "has_sig": false, "md5_digest": "d06dc9f7e6648eb053376ed4fd9c25a6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, <3.7", "size": 5373, "upload_time": "2018-04-23T00:04:10", "url": "https://files.pythonhosted.org/packages/a9/ff/6ab972255677d3c4aea1ad525a8d9a5f5d4a46cb95e614892d925ba326c5/django-generic-models-0.3.tar.gz" } ] }