{ "info": { "author": "Z. Alem", "author_email": "alem@cidola.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "===============================\nDjango Bootstrap CRUD Templates\n===============================\n\nDjango freed developers from the labor of writing boilerplate view logic with\nclass-based view; Bootstrap, the labor of designing aesthetic CSS+HTML\ncomponents.\n\nDjango Bootstrap CRUD Templates aims to unite the two, allowing developers to\nsimply write simple class-based views then select, or extend, a Bootstrap\ntemplate for complete CRUD exposure of a model. \n\nDevelopers can even do as little as define a model including a single mixin and\nrun a function to generate a set of working CRUD URLs for that model (see\nAutomatic Generation of Views and URLs).\n\nDemo_\n\n.. _Demo: http://bsct-demo.cidola.com/widget/list\n\nInstallation\n-------------\n1. ``pip install django-bootstrap-crud-templates``\n2. Add ``'bsct'`` in the ``INSTALLED_APPS`` list in your project's settings module.\n\nUsage\n-----\n\nDjango Bootstrap CRUD Templates provides a repository of Bootstrap-integrated\nDjango templates.\n\nThese templates are designed to work directly with the context variables\nprovided by the Django Class-Based View and the attributes provided by the\nDjango model.\n\nModel Requirements\n~~~~~~~~~~~~~~~~~~\n\nIn order to make the most use of the features, the Model should have a few\nattributes defined:\n\n- Instance methods:\n - ``get_absolute_url``: Returns the url to view the instance. \n ( Minimum requirement )\n\n - ``get_delete_url``: Returns the url to delete the instance.\n - ``get_update_url``: Returns the url to update the instance.\n - ``get_list_url``: Returns the url to list all instances.\n\n- Class methods:\n - ``get_create_url``: Returns the url to create an instance.\n\n\nFor example, with a delete url named 'widget_delete', get_delete_url may be\ndefined as: ::\n \n def get_delete_url( self ):\n return reverse( 'widget_delete', kwargs = {'pk' : self.pk } )\n\nYou can skip defining these methods by adding the ``BSCTModelMixin`` mixin\nclass to your model and simply naming the corresponding URLs in the following\nway:\n\n- ``lowercasemodelname_detail``: For the DetailView.\n- ``lowercasemodelname_create``: For the CreateView.\n- ``lowercasemodelname_update``: For the UpdateView.\n- ``lowercasemodelname_delete``: For the DeleteView.\n- ``lowercasemodelname_list``: For the ListView.\n\nCustomizing display of model fields\n###################################\nThe default detail views simply print the value of each field.\n\nIf you desire something more than the printed value for any field, simply\ndefine a detail method ('_detail') for that field::\n\n class Widget( models.Model )\n\n sku = models.IntegerField()\n\n def sku_detail( self ):\n return 'SKU_%d' % ( self.sku )\n\nView Requirements\n~~~~~~~~~~~~~~~~~\nTo use a template directly, as opposed to extending it, simply assign its name\nto the `template_name` attribute of the class-based view. ::\n\n # in views.py\n class CreateWidget( generic.CreateView ):\n model = models.Widget\n template_name = 'bsct/plain/form.html'\n\nTemplate Requirements\n~~~~~~~~~~~~~~~~~~~~~\nBy default, the template extends from 'base.html' and populates the \nblock BSCT_MAIN. \nTherefore, you will need to have a template named 'base.html'\nand it must contain the block BSCT_MAIN ::\n \n # base.html\n {% block BSCT_MAIN %}\n {% endblock %}\n\nIf you want to use the CDN-delivered version of Bootstrap included in the\npackage make sure your base template also defined the block BSCT_CSS ::\n\n # base.html\n {% block BSCT_CSS %}\n {% endblock %}\n\n \n \n\n {% block BSCT_MAIN %}\n {% endblock %}\n\nIf you wish to have the template extend from a template other than 'base.html',\nsimply provide its name as the value for the context variable 'bsct_base'. ::\n\n #in views.py\n class CreateWidget( generic.CreateView ):\n model = models.Widget,\n template_name = 'bsct/plain/form.html'\n \n def get_context_data(self, **kwargs):\n context = super(CreateWidget, self).get_context_data(**kwargs)\n\n context[ 'bsct_base' ] = 'my_special_widget_base.html'\n return context\n\nAutomatic Generation of Views and URLs\n--------------------------------------\n\nYou can skip the manual definition of both views and their URLs by using\nbsct.urls.URLGenerator to generate a set of URLs (and views) and including them in your applications urlpatterns::\n\n from bsct.urls import URLGenerator\n from crud import models\n\n bsct_patterns = URLGenerator( models.Widget ).get_urlpatterns()\n\n urlpatterns = patterns( '',\n url( '', include( bsct_patterns ) )\n )\n\nYou may also choose to have only a select few URLs automatically generated::\n\n urlpatterns = patterns( '',\n\n url( '', \n \n # Automatically generate the list and delete url+view.\n URLGenerator( models.Widget ).get_delete_url(),\n\n # Pass parameters to the generic ListView.\n URLGenerator( models.Widget ).get_list_url( paginate_by = 3 ),\n\n\n # Use our custom create view.\n url( \n r'^widget/create/(?P\\d+)/$',\n\n MyWidgetCreateView.as_view(), \n\n name = 'widget_create' \n ),\n ) \n )\n\nTemplate Customization\n----------------------\nCustomizing these templates is as simple as creating your own template and\nincluding the desired Django Bootstrap CRUD Templates template. ::\n\n # widget_list.html\n {% extends 'bsct/plain/list.html' %}\n\n {% block BSCT_LIST_ACTIONS %}\n Use Widget \n {% endblock %}\n\nThe default 'bsct/base.html' links to a CDN-hosted minified Bootstrap\nCSS file. If you prefer to use your own version, simply override the block\nBSCT_BOOTSTRAP_CDN. ::\n\n {% block BSCT_BOOTSTRAP_CDN %}\n {% endblock %}\n\nBuilt for developers, by developers\n-----------------------------------\nDjango Bootstrap CRUD Templates is an open source project that ultimately aims to\nhost a collection of user-submitted Bootstrap template-sets for Django. \n\nIf you have a set of Bootstrap templates you wish to include, simply \nfollow the five steps below (assuming you have a GitHub account):\n\n1. Fork and clone https://github.com/Alem/django-bootstrap-crud-templates.\n2. Ensure your set has at least two of the following templates:\n\n - form.html\n - list.html\n - detail.html\n - confirm_delete.html \n\n3. (optional) Create a README.rst with a brief description of the template set and any other pertinent information ( external dependencies, author, homepage ).\n\n4. Place all the files in \"bsct/templates/yourthemename/\".\n\n5. Pull.\n\nAll contributed templates inherit the license of the encompassing project.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://packages.python.org/django-bootstrap-crud-templates", "keywords": "django,templates. bootstrap,bootstrap templates,crud templates", "license": "GNU General Public License v3 (GPLv3)", "maintainer": null, "maintainer_email": null, "name": "django-bootstrap-crud-templates", "package_url": "https://pypi.org/project/django-bootstrap-crud-templates/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-bootstrap-crud-templates/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://packages.python.org/django-bootstrap-crud-templates" }, "release_url": "https://pypi.org/project/django-bootstrap-crud-templates/1.0.24/", "requires_dist": null, "requires_python": null, "summary": "A repository of Bootstrap CRUD templates for Django.", "version": "1.0.24" }, "last_serial": 1484273, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "a955ce60c881d8dc86628b77ff08fe62", "sha256": "3d7655eaa8f456cf01fce30ecd992bfd570638d8966015321d3f6358d3547d5c" }, "downloads": -1, "filename": "django-bootstrap-crud-templates-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a955ce60c881d8dc86628b77ff08fe62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11778, "upload_time": "2013-07-19T00:35:39", "url": "https://files.pythonhosted.org/packages/e7/6f/b447969be4abe2cdc41803d1438a12b9c3bdd6986cc3e858704e1c6d10ca/django-bootstrap-crud-templates-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "a9d8462ae679bbb0642697c2400f7314", "sha256": "a53b716cef265448e7c183a459fbd40aca031f7bcc472725bcacb411384ef0a6" }, "downloads": -1, "filename": "django-bootstrap-crud-templates-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a9d8462ae679bbb0642697c2400f7314", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11758, "upload_time": "2013-07-19T00:51:38", "url": "https://files.pythonhosted.org/packages/34/78/3a588b4a088adc6c867921894584ddb66e82e06ca1aaefa64c8a9fa70d1b/django-bootstrap-crud-templates-1.0.1.tar.gz" } ], "1.0.12": [ { "comment_text": "", "digests": { "md5": "aa2ae99064577f6b9dc55d661a8e4c7f", "sha256": "bc526b3205e24d7cb23ae249eca37fd8bb7599000ed2f0551818db632d7e8ab4" }, "downloads": -1, "filename": "django-bootstrap-crud-templates-1.0.12.tar.gz", "has_sig": false, "md5_digest": "aa2ae99064577f6b9dc55d661a8e4c7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12880, "upload_time": "2013-07-31T03:41:58", "url": "https://files.pythonhosted.org/packages/73/47/9b0c8409d97d7c732f2513a1b8874529180701e69aba0e8f1e937ef6c21f/django-bootstrap-crud-templates-1.0.12.tar.gz" } ], "1.0.15": [ { "comment_text": "", "digests": { "md5": "aba0dbbac9610ef76dbc13d033164c40", "sha256": "a601051935bf3423a644cf7ffacf6779dd888fe49f8553e15a9fbd35a38fa3bb" }, "downloads": -1, "filename": "django-bootstrap-crud-templates-1.0.15.tar.gz", "has_sig": false, "md5_digest": "aba0dbbac9610ef76dbc13d033164c40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17113, "upload_time": "2014-05-21T02:56:09", "url": "https://files.pythonhosted.org/packages/43/a0/f969e7ec3d33067cb30c45789fe5de1b55f9bc276bd5b61db3d501464057/django-bootstrap-crud-templates-1.0.15.tar.gz" } ], "1.0.17": [ { "comment_text": "", "digests": { "md5": "8ced89062043c41f9b2eac7bf254c277", "sha256": "9b70d5076d8cb8227762b1aa6ba51989388f81286ec13acca9d2ba24f3cde6fd" }, "downloads": -1, "filename": "django-bootstrap-crud-templates-1.0.17.tar.gz", "has_sig": false, "md5_digest": "8ced89062043c41f9b2eac7bf254c277", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17044, "upload_time": "2014-05-21T04:05:25", "url": "https://files.pythonhosted.org/packages/ea/f2/6df3a6e4c1d74ecaa2105147b3d11d75ca2e716a81b14c15d0c1dfd3334e/django-bootstrap-crud-templates-1.0.17.tar.gz" } ], "1.0.22": [ { "comment_text": "", "digests": { "md5": "63c98078b61015454c9e970f007a6eca", "sha256": "c48313e4e84c8b26697df9be3ef7226760d8a2c2caed467f07328dc3a3a30c97" }, "downloads": -1, "filename": "django-bootstrap-crud-templates-1.0.22.tar.gz", "has_sig": false, "md5_digest": "63c98078b61015454c9e970f007a6eca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10975, "upload_time": "2014-10-05T01:58:23", "url": "https://files.pythonhosted.org/packages/ba/e7/70736e03edde6865637ae44d83f5da2e7f726c4d20a214ceaf3a7c95cf9a/django-bootstrap-crud-templates-1.0.22.tar.gz" } ], "1.0.24": [ { "comment_text": "", "digests": { "md5": "165dbc71837d81cd3ccc84ec6c7b85de", "sha256": "d3eece04e0efd87f76d490a05e0a573aae3b7892d7a7ebe565ce8e56c6c7af4c" }, "downloads": -1, "filename": "django-bootstrap-crud-templates-1.0.24.tar.gz", "has_sig": false, "md5_digest": "165dbc71837d81cd3ccc84ec6c7b85de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11108, "upload_time": "2015-03-31T04:08:13", "url": "https://files.pythonhosted.org/packages/fa/a5/03a25ce929495fc0f442968c436e2e42fa7b79e5fde0bb2ba858b0fb985a/django-bootstrap-crud-templates-1.0.24.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "165dbc71837d81cd3ccc84ec6c7b85de", "sha256": "d3eece04e0efd87f76d490a05e0a573aae3b7892d7a7ebe565ce8e56c6c7af4c" }, "downloads": -1, "filename": "django-bootstrap-crud-templates-1.0.24.tar.gz", "has_sig": false, "md5_digest": "165dbc71837d81cd3ccc84ec6c7b85de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11108, "upload_time": "2015-03-31T04:08:13", "url": "https://files.pythonhosted.org/packages/fa/a5/03a25ce929495fc0f442968c436e2e42fa7b79e5fde0bb2ba858b0fb985a/django-bootstrap-crud-templates-1.0.24.tar.gz" } ] }