Django-based framework for rapid application development.
Project description
Blitz Work
Blitz Work is a Django-based framework for rapid application development
How to use
-
Add blitz_work to installed apps in settings.py.
INSTALLED_APPS = [ ..., ..., 'blitz_work', ]
-
Create the models.
from django.db import models class Author(models.Model): name = models.CharField(verbose_name="Name", max_length=255) birth_date = models.DateField(verbose_name="Birth date") class Meta: verbose_name = "Author" verbose_name_plural = "Authors" def __str__(self): return self.name class Book(models.Model): title = models.CharField(verbose_name="Title", max_length=255) publication_date = models.DateField(verbose_name="Publication date") authors = models.ManyToManyField(Author,verbose_name="Authors") class Meta: verbose_name = "Book" verbose_name_plural = "Books" def __str__(self): return self.title
-
Create the template.
{% extends 'blitz_base_offline.html' %} {% block main %} <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#">Test</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarNavDropdown"> <ul class="navbar-nav"> <li class="nav-item"> <a class="nav-link" href="{% url 'book/view' %}">Libros</a> </li> <li class="nav-item"> <a class="nav-link" href="{% url 'author/view' %}">Autores</a> </li> </ul> </div> </nav> {% block content %}{% endblock %} {% endblock %}
-
Create the views.
from Book.models import Author, Book from blitz_work.blitzcrud import BlitzCRUD class BookCRUD(BlitzCRUD): show_title = True show_caption = False caption_is_title = True extend_template = "base.html" data = Book class AuthorCRUD(BlitzCRUD): show_title = True show_caption = False caption_is_title = True extend_template = "base.html" data = Author
-
Include the URLs.
from app.views import AuthorCRUD, BookCRUD from django.urls import path,include from blitz_work.blitzcrud import get_urls urlpatterns = [ path('book/', include(get_urls(BookCRUD,"book"))), path('author/', include(get_urls(AuthorCRUD,"author"))), ]
-
More help
-
Include Blitz Work help urls in urls.py
from blitz_work.urls import urlpatterns urlpatterns = [ path('',include(urlpatterns)), ]
-
Run the server.
python manage.py runserver localhost:8000
-
Go to the url blitz-doc-en/ or blitz-doc-es/
-
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
blitz_work-0.4.20.tar.gz
(1.7 MB
view details)
Built Distribution
File details
Details for the file blitz_work-0.4.20.tar.gz
.
File metadata
- Download URL: blitz_work-0.4.20.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e27f9bb2dfe736e6281dd282449ab109c88a47de58ce0aeaf149ec5418dd961 |
|
MD5 | c1cc728ffae044c81b73579c5ea7352f |
|
BLAKE2b-256 | d66e9a000310dec823be9dec3e6c9626a08c8a15f3833b3c10017e83bb9c78f4 |
File details
Details for the file blitz_work-0.4.20-py3-none-any.whl
.
File metadata
- Download URL: blitz_work-0.4.20-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 064a0d67ab3a12571248591ebaad370a7fac54e5f3fb397e555cd68bfb5b5b9a |
|
MD5 | 91d9c8edf716e313a60f19f980cd94b9 |
|
BLAKE2b-256 | 4ee9eee75831b888cd3569256a33343d66ad5de24721fbac77236e83e56680e6 |