{ "info": { "author": "MrJmad", "author_email": "j-mad@j-mad.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Information Technology", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "# django-fieldbustier\n\nThe purpose of this django-app is to allow you to add fields to models from another application.\n\n## Why this name?\n\nBecause wanting to add models from another django-app, from your own, is a bit like wanting to get on a boat and do it by shouting \"All Aboard\", a knife between your teeth.\n\nAnd in French, a pirate is also a \"flibustier\", a word quite close to fieldbustier, so -> django-fieldbustier.\n\n## How to use it django-fieldbustier\n\nyou must declare the fields you want to add, modify or delete in your settings.\n\nThere are three configuration variables that are:\n- ADD_FIELD_DJANGO_FIELDBUSTIER to add fields\n- REPLACE_FIELD_DJANGO_FIELDBUSTIER to modify fields\n- DELETE_FIELD_DJANGO_FIELDBUSTIER to delete fields\n\nTo add or modify fields you must use `FieldBustierConfig`. To delete people you must use `DeleteFieldBustierConfig`.\n\n\n`FieldBustierConfig` are `namedtuple` with these attributes :\n - app_name\n - model_klass\n - field_name\n - field_klass (You can use Django Field or your Field)\n - args (a tuple for positional args)\n - kwargs (a dict for keyword args)\n\n`DeleteFieldBustierConfig` are `namedtuple` with these attributes :\n - app_name\n - model_klass\n - field_name\n\n\n### Add a Field\n\n```\nfrom django_fieldbustier.fieldbustier_config import FieldBustierConfig\n\nADD_FIELD_DJANGO_FIELDBUSTIER = [\n FieldBustierConfig(\n \"demo_app\",\n \"DummyModel\",\n \"new_char_field\",\n \"CharField\",\n (\"An another CharField\",),\n {\"blank\": True, \"max_length\": 200},\n )\n]\n```\n\n### Modify a Field\n\n\n```\nfrom django_fieldbustier.fieldbustier_config import FieldBustierConfig\n\nREPLACE_FIELD_DJANGO_FIELDBUSTIER = [\n FieldBustierConfig(\n app_name=\"demo_app\",\n model_klass=\"DummyModel\",\n field_name=\"char_field\",\n field_klass=\"CharField\",\n args=(\"CharField FieldBusted !\",),\n kwargs={\"blank\": True, \"max_length\": 200},\n ),\n FieldBustierConfig(\n \"demo_app\",\n \"DummyModel\",\n \"decimal_field\",\n \"DecimalField\",\n (\"Decimal Field FieldBustier\",),\n {\"default\": 2.3, \"max_digits\": 14, \"decimal_places\": 3},\n ),\n]\n```\n\n### Delete a Field\n\n```\nfrom django_fieldbustier.fieldbustier_config import FieldBustierConfig\n\nDELETE_FIELD_DJANGO_FIELDBUSTIER = [DeleteFieldBustierConfig(\"demo_app\",\n \"DummyModel\",\n \"int_field\")]\n```\n\n## Migrations\n\n### GENERATE_FIELDBUSTIER_MIGRATIONS option\n\nIf you have used SQL to directly implement your changes, then you will not want the migrations to be generated.\n\nTo do this, you just have to set (in your settings) GENERATE_FIELDBUSTIER_MIGRATIONS at False.\n\n### Location of migration files\n\nBy default, the migration files of an application are located in the application. In our case, if you use Django-Fieldbustier, it is to avoid modifying the target application. This behavior is therefore not appropriate at all.\n\nTo avoid this, simply use django's MIGRATION_MODULES variable to choose where you want your migrations to be generated.\n\n\n\n## Thanks\n\nThanks for Olivier Meunier, Creme CRM codebase and Mezzanine injection Fields system for the original idea.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-fieldbustier", "package_url": "https://pypi.org/project/django-fieldbustier/", "platform": "", "project_url": "https://pypi.org/project/django-fieldbustier/", "project_urls": null, "release_url": "https://pypi.org/project/django-fieldbustier/0.7.1/", "requires_dist": null, "requires_python": "", "summary": "It allows modifying a model of an django app from the outside, without modifying the code of the app.", "version": "0.7.1" }, "last_serial": 4861366, "releases": { "0.7.1": [ { "comment_text": "", "digests": { "md5": "a0420235a93be2d0f154c368c6e7bf61", "sha256": "e9126fad0c869c261135093f1e516044fa1dd3879cc538005f5315bb06cc9e22" }, "downloads": -1, "filename": "django_fieldbustier-0.7.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a0420235a93be2d0f154c368c6e7bf61", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5366, "upload_time": "2019-02-24T16:07:14", "url": "https://files.pythonhosted.org/packages/26/b3/09030ff27be6177ae0e6e768a22f75c5b9f958a4b343e7ae67667afd67bd/django_fieldbustier-0.7.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c9a3f116ffd3e2ede4ce6961e4eb1650", "sha256": "bdc9dc9c4b1c4de7bcd642b3e22f4e7d1fdc95fd00e290712005e211bd631077" }, "downloads": -1, "filename": "django-fieldbustier-0.7.1.tar.gz", "has_sig": false, "md5_digest": "c9a3f116ffd3e2ede4ce6961e4eb1650", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5098, "upload_time": "2019-02-24T16:07:16", "url": "https://files.pythonhosted.org/packages/1e/84/e9152cbdba2a1ddd20e6db713e99b4b3e8c755facda76b7ccce96b126483/django-fieldbustier-0.7.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a0420235a93be2d0f154c368c6e7bf61", "sha256": "e9126fad0c869c261135093f1e516044fa1dd3879cc538005f5315bb06cc9e22" }, "downloads": -1, "filename": "django_fieldbustier-0.7.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a0420235a93be2d0f154c368c6e7bf61", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5366, "upload_time": "2019-02-24T16:07:14", "url": "https://files.pythonhosted.org/packages/26/b3/09030ff27be6177ae0e6e768a22f75c5b9f958a4b343e7ae67667afd67bd/django_fieldbustier-0.7.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c9a3f116ffd3e2ede4ce6961e4eb1650", "sha256": "bdc9dc9c4b1c4de7bcd642b3e22f4e7d1fdc95fd00e290712005e211bd631077" }, "downloads": -1, "filename": "django-fieldbustier-0.7.1.tar.gz", "has_sig": false, "md5_digest": "c9a3f116ffd3e2ede4ce6961e4eb1650", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5098, "upload_time": "2019-02-24T16:07:16", "url": "https://files.pythonhosted.org/packages/1e/84/e9152cbdba2a1ddd20e6db713e99b4b3e8c755facda76b7ccce96b126483/django-fieldbustier-0.7.1.tar.gz" } ] }