A simple Django CRUD builder
Project description
# django-crudbuilder
Generic CRUD implementation in Django which uses django tables2 to list objects
Installation
------------
`pip install django-crudbuilder`
Usage
-----
```
1. Add "crudbuilder" to INSTALLED_APPS:
INSTALLED_APPS = {
...
'crudbuilder'
}
2. Open urls.py and add the following
from crudbuilder.urls import UrlBuilder
urlpatterns = [
# Examples:
# url(r'^$', 'example.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
]
builder = UrlBuilder('yourappname', 'yourmodelname', table_fields=('name', 'email'))
urlpatterns += builder.urls
3. Now you can access the below CRUD URLS:
- http://127.0.0.1:8000/yourappname/yourmodelname
- http://127.0.0.1:8000/yourappname/yourmodelname/create/
- http://127.0.0.1:8000/yourappname/yourmodelname/<pk>/detail/
- http://127.0.0.1:8000/yourappname/yourmodelname/<pk>/update/
- http://127.0.0.1:8000/yourappname/yourmodelname/<pk>/delete/
```
EXTRA TEMPLATE VARIABLES
------------------------
Added mixin which allows access to additional template variables like app lable and model name in every template.
```
APP : {{app_label}}
MODEL : {{actual_model_name}}
PLURIZED MODEL : {{pluralized_model_name}}
```
HELPERS
-------
All the generated views/tables/forms/url are extendable.
[Visit CRUD BUILDER helpers!](https://github.com/asifpy/django-crudbuilder/blob/master/example/example/usage.py)
Generic CRUD implementation in Django which uses django tables2 to list objects
Installation
------------
`pip install django-crudbuilder`
Usage
-----
```
1. Add "crudbuilder" to INSTALLED_APPS:
INSTALLED_APPS = {
...
'crudbuilder'
}
2. Open urls.py and add the following
from crudbuilder.urls import UrlBuilder
urlpatterns = [
# Examples:
# url(r'^$', 'example.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
]
builder = UrlBuilder('yourappname', 'yourmodelname', table_fields=('name', 'email'))
urlpatterns += builder.urls
3. Now you can access the below CRUD URLS:
- http://127.0.0.1:8000/yourappname/yourmodelname
- http://127.0.0.1:8000/yourappname/yourmodelname/create/
- http://127.0.0.1:8000/yourappname/yourmodelname/<pk>/detail/
- http://127.0.0.1:8000/yourappname/yourmodelname/<pk>/update/
- http://127.0.0.1:8000/yourappname/yourmodelname/<pk>/delete/
```
EXTRA TEMPLATE VARIABLES
------------------------
Added mixin which allows access to additional template variables like app lable and model name in every template.
```
APP : {{app_label}}
MODEL : {{actual_model_name}}
PLURIZED MODEL : {{pluralized_model_name}}
```
HELPERS
-------
All the generated views/tables/forms/url are extendable.
[Visit CRUD BUILDER helpers!](https://github.com/asifpy/django-crudbuilder/blob/master/example/example/usage.py)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-crudbuilder-0.0.4.tar.gz
(11.4 kB
view details)
File details
Details for the file django-crudbuilder-0.0.4.tar.gz
.
File metadata
- Download URL: django-crudbuilder-0.0.4.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a93376c78f1d1c4fdbf7f7bed79289e2ba7ee2dd7723a19b67427606479dc5e |
|
MD5 | 255add9b8208b25517eadd22f5652207 |
|
BLAKE2b-256 | 35baa3df8e82e0bf8e38970ec1c61c9a4b1519c8828b46be15bd445db8a7ae43 |