{"id":14972215,"url":"https://github.com/asifpy/django-crudbuilder","last_synced_at":"2025-04-05T04:10:30.864Z","repository":{"id":38429098,"uuid":"44615214","full_name":"asifpy/django-crudbuilder","owner":"asifpy","description":"Generic CRUD implementation in Django","archived":false,"fork":false,"pushed_at":"2023-08-28T15:13:03.000Z","size":615,"stargazers_count":195,"open_issues_count":8,"forks_count":68,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-29T03:07:44.370Z","etag":null,"topics":["asifpy","bootstrap3","crud","crud-builder","crud-generator","crud-maker","django","django-crudbuilder","python"],"latest_commit_sha":null,"homepage":"https://django-crudbuilder.readthedocs.org/en/latest/index.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asifpy.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-20T15:18:50.000Z","updated_at":"2024-11-07T23:48:43.000Z","dependencies_parsed_at":"2024-06-19T10:00:12.804Z","dependency_job_id":"dc3c88af-2c5b-4bbb-8288-08099f266c08","html_url":"https://github.com/asifpy/django-crudbuilder","commit_stats":{"total_commits":216,"total_committers":17,"mean_commits":"12.705882352941176","dds":0.3287037037037037,"last_synced_commit":"c199acfe6c01e696ef49d71506b01e676bcf7add"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asifpy%2Fdjango-crudbuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asifpy%2Fdjango-crudbuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asifpy%2Fdjango-crudbuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asifpy%2Fdjango-crudbuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asifpy","download_url":"https://codeload.github.com/asifpy/django-crudbuilder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284949,"owners_count":20913704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asifpy","bootstrap3","crud","crud-builder","crud-generator","crud-maker","django","django-crudbuilder","python"],"created_at":"2024-09-24T13:46:34.156Z","updated_at":"2025-04-05T04:10:30.835Z","avatar_url":"https://github.com/asifpy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"|Build|_ |CodeHealth|_ |coverage|_ |pypi|_ |CodeQuality|_\n\n.. |Build| image:: https://travis-ci.org/asifpy/django-crudbuilder.svg?branch=master\n.. _Build: https://travis-ci.org/asifpy/django-crudbuilder\n\n.. |CodeHealth| image:: https://landscape.io/github/asifpy/django-crudbuilder/master/landscape.svg?style=flat\n.. _CodeHealth: https://landscape.io/github/asifpy/django-crudbuilder/master\n\n.. |pypi| image:: https://img.shields.io/pypi/v/django-crudbuilder.svg\n.. _pypi: https://pypi.python.org/pypi/django-crudbuilder\n\n.. |CodeQuality| image:: https://scrutinizer-ci.com/g/asifpy/django-crudbuilder/badges/build.png?b=master\n.. _CodeQuality: https://scrutinizer-ci.com/g/asifpy/django-crudbuilder/?branch=master\n\n.. |coverage| image:: https://coveralls.io/repos/github/asifpy/django-crudbuilder/badge.svg?branch=master\n.. _coverage: https://coveralls.io/github/asifpy/django-crudbuilder?branch=master \n\n\n==================\ndjango-crudbuilder\n==================\n\nGeneric CRUD implementation in Django which uses django tables2 to list objects.\n\nDocumentation\n-------------\n\nhttps://django-crudbuilder.readthedocs.org/en/latest/index.html\n\nFeatures:\n---------\n\n- Generates class based views for CRUD\n- Uses django-tables2 to display objects in ListView\n- Define multiple crud builders for same model with separate URL\n- Allows custom forms/tables as additional arguments\n- Context provides additional template variables APP_LABEL and MODEL for all CRUD templates\n- Enable/disable login required option for CRUD views\n- Enable/disable permission required option for CRUD views\n- All the generated views/tables/forms/url are extendable.\n- post_create and post_update signals to handle specific actions in Create and Update views\n- Add your own custom templates for List/Create/Detail/Update/Delete views\n- Separate CREATE and UPDATE forms\n- Define your own custom queryset for list view\n- Inline Formset support for parent child models\n- Default Bootstrap3 CSS\n- All the generated views are extendable.\n\nPrerequisites\n-------------\n- Django 1.10+\n- Python 2.7+, 3.3+\n- [Django Tables2](https://django-tables2.readthedocs.io/)\n\nInstallation\n------------\n\n.. code-block:: python\n\n    pip install django-crudbuilder\n\nUsage\n-----\n\n**Add \"crudbuilder\" to INSTALLED_APPS**\n\n.. code-block:: python\n\n\tINSTALLED_APPS = {\n\t\t...\n\t\t'django_tables2',\n\t\t'crudbuilder'\n\t}\n\n\tLOGIN_REQUIRED_FOR_CRUD = True/False\n\tPERMISSION_REQUIRED_FOR_CRUD = True/False\n\tPROJECT_NAME = 'YOUR PROJECT NAME'\n\n**Create models in yourapp/models.py**\n\n.. code-block:: python\n\n\tclass Person(models.Model):\n\t\t\"\"\" an actual singular human being \"\"\"\n\t\tname = models.CharField(blank=True, max_length=100)\n\t\temail = models.EmailField()\n\t\tcreated_at = models.DateTimeField(auto_now=True)\n\t\tcreated_by = models.ForeignKey(User, blank=True, null=True)\n\n\t\tdef __unicode__(self):\n\t\t\treturn self.name\n\n**Create CRUD for Person model in yourapp/crud.py**\n\n.. code-block:: python\n\n\tfrom crudbuilder.abstract import BaseCrudBuilder\n  \tfrom yourapp.models import Person\n\n  \tclass PersonCrud(BaseCrudBuilder):\n  \t\tmodel = Person\n  \t\tsearch_fields = ['name']\n  \t\ttables2_fields = ('name', 'email')\n  \t\ttables2_css_class = \"table table-bordered table-condensed\"\n  \t\ttables2_pagination = 20  # default is 10\n  \t\tmodelform_excludes = ['created_by', 'updated_by']\n  \t\tlogin_required=True\n  \t\tpermission_required=True\n  \t\t# permissions = {\n  \t\t#   'list': 'example.person_list',\n  \t\t#\t'create': 'example.person_create'\n  \t\t# }\n\n\n**Open yourapp/urls.py and add the following**\n\n.. code-block:: python\n\t\n\tfrom crudbuilder import urls\n\n\turlpatterns = [\n\t\turl(r'^admin/', include(admin.site.urls)),\n\t\turl(r'^crud/',  include(urls)),\n\t]\n\n**View All your registered CRUDS**\n\n.. code-block:: python\n\n\thttp://127.0.0.1:8000/crud/\n\n\n**Now you can access the below CRUD URLS**\n\n.. code-block:: python\n\n\t- http://127.0.0.1:8000/crud/yourappname/yourmodelname\n\t- http://127.0.0.1:8000/crud/yourappname/yourmodelname/create/\n\t- http://127.0.0.1:8000/crud/yourappname/yourmodelname/\u003cpk\u003e/detail/\n\t- http://127.0.0.1:8000/crud/yourappname/yourmodelname/\u003cpk\u003e/update/\n\t- http://127.0.0.1:8000/crud/yourappname/yourmodelname/\u003cpk\u003e/delete/\n\n\nLOGIN REQUIRED\n--------------\n\nTo enable global login required for all the models CRUD views, add the following to settings file\n\n.. code-block:: python\n\n\tLOGIN_REQUIRED_FOR_CRUD = True\n\nIf you want to enable login required only for specific model crud, then you need to add following to crud class\n\n\t.. code-block:: python\n\t\t\n\t\t# myapp/crud.py\n\t\tlogin_required = True\n\n\nPERMISSION REQUIRED\n-------------------\n\nTo enable global permission required for all the models CRUD views, add the following to settings file\n\n.. code-block:: python\n\n\tPERMISSION_REQUIRED_FOR_CRUD = True\n\nIf you want to enable permission required only for specific model crud, then you need to add following to crud class\n\n\t.. code-block:: python\n\t\t\n\t\t# myapp/crud.py\n\t\tpermission_required = True\n\nBy enabling either of above flag, crudbuilder by default checks for following permissions:\n\n.. code-block:: python\n\t\n\t- For ListView   : \u003cyour app_name\u003e.\u003cyour model\u003e_list\n\t- For CreateView : \u003cyour app_name\u003e.\u003cyour model\u003e_create\n\t- For DetailView : \u003cyour app_name\u003e.\u003cyour model\u003e_detail\n\t- For UpdateView : \u003cyour app_name\u003e.\u003cyour model\u003e_update\n\t- For DeleteView : \u003cyour app_name\u003e.\u003cyour model\u003e_delete\n\n\nIf you want to add your own permissions, then define your own permission required dictionary explicitly in CRUD class.\n\n.. code-block:: python\n\t\n\tpermissions = {\n\t\t'list'  : 'example.permission1',\n\t\t'create': 'example.permission2'\n\t\t'detail': 'example.permission3',\n\t\t'update': 'example.permission4',\n\t\t'delete': 'example.permission5',\n\t\t}\n\nEXTRA TEMPLATE VARIABLES\n------------------------\nAdded mixin which allows access to additional template variables like app lable and model name in every template.\n\n.. code-block:: python\n\n\tAPP : {{app_label}}\n\tMODEL : {{actual_model_name}}\n\tPLURIZED MODEL : {{pluralized_model_name}}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasifpy%2Fdjango-crudbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasifpy%2Fdjango-crudbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasifpy%2Fdjango-crudbuilder/lists"}