Skip to main content

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

  1. Add blitz_work to installed apps in settings.py.

    INSTALLED_APPS = [
     ...,
     ...,
     'blitz_work',
    ]
    
  2. 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
    
  3. 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 %}
    
  4. 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
    
  5. 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"))),
     ]
    
  6. More help

    1. Include Blitz Work help urls in urls.py

      from blitz_work.urls import urlpatterns
      
      urlpatterns = [
           path('',include(urlpatterns)),
      ]
      
    2. Run the server.

      python manage.py runserver localhost:8000
      
    3. Go to the url blitz-doc-en/ or blitz-doc-es/

Project details


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.5.23.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

blitz_work-0.5.23-py3-none-any.whl (2.3 MB view details)

Uploaded Python 3

File details

Details for the file blitz_work-0.5.23.tar.gz.

File metadata

  • Download URL: blitz_work-0.5.23.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.6

File hashes

Hashes for blitz_work-0.5.23.tar.gz
Algorithm Hash digest
SHA256 3771536165e9e1367bfe1a5b4d00ed646f37436c6cfac51d03c8dfd4ad907a10
MD5 dc0b6c912bf78b3321dd1cf76c437d17
BLAKE2b-256 4e518c530b17786e8935b788cbdd9936c29b43ffa59504336d52b697f15e63ec

See more details on using hashes here.

File details

Details for the file blitz_work-0.5.23-py3-none-any.whl.

File metadata

  • Download URL: blitz_work-0.5.23-py3-none-any.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.6

File hashes

Hashes for blitz_work-0.5.23-py3-none-any.whl
Algorithm Hash digest
SHA256 171cb33d67a7d83c3f6f3949b060febd47f54c4f21d736c3af3d2863df983c55
MD5 615899345869c7d539f3ad51c0d7e287
BLAKE2b-256 f0c34092c6b6c5fb76315c870947b48737c2712781ecbae9873573b17c9ab3b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page