{ "info": { "author": "Jorge Perez", "author_email": "japrogramer@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "***********************************************\ndjango-amorphous unlocks the power of JsonField\n***********************************************\n\n=============\nMain Features\n=============\n\ndjango-amorphous allows you to store data that you would normally need to\ncreate models for and run migrations against, if there are changes are made to\ntheir structure, in a **single** JsonField.\n\nAmorphous makes this possible by defining a data structure that stores the\nfields type and data, as well as any kwargs that are used to instantiate the\nfield.\n\n===========\nAn example:\n===========\n\nthe code:\n\n.. code-block:: python\n\n # First import the class generator\n >>> from amorphous.forms import amorphous_gen\n\n # Than define the structure of the data\n >>> json_data = {\n 'first': [\n 'BooleanField',\n {\n 'initial': True,\n 'required': False}, ],\n 'second': [\n 'CharField',\n {'initial': 'This is a test'}]}\n\nFinally generate the form class from there you have two choices:\ncreate an instance of that class\nor create a form with initial values set with data from the DB:\n\n.. code-block:: python\n\n >>> form_class = amorphous_gen(amorphous=json_data)\n >>> form_instance = form_class()\n # Using data from object in DB.\n # This creates a form class where the initial values are the values stored\n # in the DB\n # Note: the form is not bound\n >>> form_instance = amorphous_gen(obj.field)\n # this is usefull when dealing with post and get methods\n\n\nTo store the data, in the format expected by amorphous use the db_amorphous\nform method:\n\n.. code-block:: python\n\n >>> for_db = form.db_amorphous()\n\nsave the object after setting the attribute, where amorphous_field is the\nname of the field that holds the amorphous data on the model:\n\n.. code-block::python\n\n >>> setattr(model_object, amorphous_field, for_db)\n\n=====\nUsage\n=====\n\namorphous contains a CBV, AmorphousView that takes the name of the JsonField\nthat you wish to store the amorphous data into **amorphous_field** and also\nexpects the model attribute to be set:\n\n.. code-block:: python\n\n >>> view = AmorphousView.as_view(\n template_name='amorphous_test/model_amo.html',\n model=TestModel,\n form_class=self.test_form_class,\n amorphous_field='metadata')\n\nThis view takes care of displaying, validating and saving the form as expected\nand certain methods can be overridden to add or remove functionality like in any\nCBV.\n\n=====\nTests\n=====\nrunning tests:\n\n.. code-block:: bash\n\n # just amorphous' tests\n $ manage.py test amorphous\n # amorphous' tests and your tests\n $ manage.py test . amorphous\n\n=================\nThe possibilities\n=================\n\nWith this package, you can store different schemas in the same field.\nLets say that one of the data structures you have been storing has changed\nbut only new data uses the new schema and the old data doesn't need a migration.\n\nSince the Form class is generated on the fly and assuming no restraints are\napplied to the JsonField to be used amorphously, the Form can adapt depending on\nwhat version is being used. Consider how the form structure is stored, because of\nthis, the behavior of having multiple schemas per amorphous field comes nearly\nfree.\n\nIn the real world, this can be used to create a tag, category, or even a\nlanguage translation system. Since for this apps you would need to add or remove\nitems to them dynamically, and a schema binded implementation would make their\nimplementation difficult. However with an amorphous field, they become trivial.", "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/japrogramer/django-amorphous", "keywords": "django json JsonField amorphous", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-amorphous", "package_url": "https://pypi.org/project/django-amorphous/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-amorphous/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/japrogramer/django-amorphous" }, "release_url": "https://pypi.org/project/django-amorphous/0.7/", "requires_dist": null, "requires_python": null, "summary": "django-amorphous unlocks the power of JsonField", "version": "0.7" }, "last_serial": 1975430, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d9e6787887065f0b7e0864673920f7a2", "sha256": "9b6545d298f09f69f419f9570f6c9d2030c1dd31f298309bbc5e52a31f0781d5" }, "downloads": -1, "filename": "django-amorphous-0.1.tar.gz", "has_sig": false, "md5_digest": "d9e6787887065f0b7e0864673920f7a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2113, "upload_time": "2016-02-21T04:31:29", "url": "https://files.pythonhosted.org/packages/50/64/b5aa3dc79208f2484ec6c6501b617a237bff91847d5536489234db73edc6/django-amorphous-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "859a557ebba2884d93e745868657b9dd", "sha256": "78f7e17a4a3b2d4f760931ef1c69e9b03ee0f5e1f447797c71b6c8b5a73a5be1" }, "downloads": -1, "filename": "django-amorphous-0.2.tar.gz", "has_sig": false, "md5_digest": "859a557ebba2884d93e745868657b9dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3623, "upload_time": "2016-02-21T04:57:12", "url": "https://files.pythonhosted.org/packages/0b/bb/cbe6c5ff73ce0c1aad3f29de172cadd86ca1385ed2499971afe49bbc9694/django-amorphous-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "fb3d2c9e52ea7848c259477039a5ee19", "sha256": "295fe80a8eb3f2250eaaf65b7c7fc7a3b341a8020fea1a78e742b6bc06d278df" }, "downloads": -1, "filename": "django-amorphous-0.3.tar.gz", "has_sig": false, "md5_digest": "fb3d2c9e52ea7848c259477039a5ee19", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4607, "upload_time": "2016-02-21T05:17:53", "url": "https://files.pythonhosted.org/packages/60/37/be654fe0c95781b9496d10f72e38fdef084a301e7dca77501625dbecfedb/django-amorphous-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "41a71432fb50fbc78e01736df76463a1", "sha256": "a4855991c199ab86a2b25338af3c1f203d9b03ed023b8643b14feb214f7c2a41" }, "downloads": -1, "filename": "django-amorphous-0.4.tar.gz", "has_sig": false, "md5_digest": "41a71432fb50fbc78e01736df76463a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5007, "upload_time": "2016-02-22T01:07:37", "url": "https://files.pythonhosted.org/packages/cf/45/2c128ae034d793451e61151a6afa34e292275674fe63bade078f04aaab41/django-amorphous-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "e5b75e87c58a18f5126ddc22c5236d47", "sha256": "c8312951f47b307b97d47bcd59072458378f6e52d8170fc5dae70cc12f600d66" }, "downloads": -1, "filename": "django-amorphous-0.5.tar.gz", "has_sig": false, "md5_digest": "e5b75e87c58a18f5126ddc22c5236d47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5629, "upload_time": "2016-02-22T18:32:57", "url": "https://files.pythonhosted.org/packages/73/28/ccf2127503a9e66570b821e91375c6a5494d50cfea42f0e16f4babe46121/django-amorphous-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "b83871213ce6a12508278c353cf5a71a", "sha256": "2bc88fde3f63ac4e9606632e8df73c751574ce3fe0ea17292f06e7ba92c25c29" }, "downloads": -1, "filename": "django-amorphous-0.6.tar.gz", "has_sig": false, "md5_digest": "b83871213ce6a12508278c353cf5a71a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5617, "upload_time": "2016-02-24T22:25:36", "url": "https://files.pythonhosted.org/packages/e4/7e/8db152ab5ae0a78a3ddc4ae5cbf1aa7310b2b81c41b718e7dadcc328a1fe/django-amorphous-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "a55d739ec4d97f3ead89839f585d53ce", "sha256": "81298c2a0149e4bd334dca2d03f7b33000a755ee33ebd4199c9751cf619cf1c5" }, "downloads": -1, "filename": "django-amorphous-0.7.tar.gz", "has_sig": false, "md5_digest": "a55d739ec4d97f3ead89839f585d53ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5661, "upload_time": "2016-02-25T02:58:29", "url": "https://files.pythonhosted.org/packages/2a/4c/46a66ddc5fd68e8c3875a1b06510eeabe6d46a5a8ad8c6d413f1379b0e00/django-amorphous-0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a55d739ec4d97f3ead89839f585d53ce", "sha256": "81298c2a0149e4bd334dca2d03f7b33000a755ee33ebd4199c9751cf619cf1c5" }, "downloads": -1, "filename": "django-amorphous-0.7.tar.gz", "has_sig": false, "md5_digest": "a55d739ec4d97f3ead89839f585d53ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5661, "upload_time": "2016-02-25T02:58:29", "url": "https://files.pythonhosted.org/packages/2a/4c/46a66ddc5fd68e8c3875a1b06510eeabe6d46a5a8ad8c6d413f1379b0e00/django-amorphous-0.7.tar.gz" } ] }