Skip to main content

Extra widgets for django using gentelella.

Project description

This app helps you to integrate Django apps with Gentelella building extra widgets for forms and speciall methods to render forms in templates.

See Documentation

Installation

Installing from repository (Updated frequently, most of great functionalities are not in pip yet ).

pip install git+https://github.com/luisza/django-gentelella-widgets.git#egg=djgentelella

An stable version on pip, but not all available widget are in this release (new release comming soon)

pip install djgentelella

Configure your settings

INSTALLED_APPS = [ ..
    'djgentelella',
    'mptt',
    'rest_framework',
    'chunked_upload',
    'markitup',
]

USE_L10N = False

MARKITUP_FILTER = ('markdown.markdown', {'safe_mode': True})
MARKITUP_SET = 'markitup/sets/markdown/'
JQUERY_URL = None

DATE_INPUT_FORMATS=[
    '%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y'
]
DATE_FORMAT= ['%d/%m/%Y',]

DATETIME_INPUT_FORMATS = [
    '%m/%d/%Y %H:%M',
    '%d/%m/%Y %H:%M',
    '%Y-%m-%d %H:%M',
    '%d/%m/%y %H:%M'
]

Run migrations

python manage.py migrate

Create statics files downloading from internet (you need to install requests for this step).

pip install requests
python manage.py loaddevstatic

Add djgentelella urls in your project urls.py file

from djgentelella.urls import urlpatterns as djgentelellaurls

urlpatterns = djgentelellaurls + [
                ...
              ]

Usage

In forms

from djgentelella.forms.forms import GTForm
from djgentelella.widgets import core as genwidgets

class myform(GTForm, forms.ModelForm):
    class Meta:
        model = MyObject
        fields = '__all__'
        widgets = {
            'name': genwidgets.TextInput,
            'borddate': genwidgets.DateInput,
            'email': genwidgets.EmailMaskInput
        }

In templates working with forms

{{ form.as_plain }}
{{ form.as_inline }}
{{ form.as_horizontal }}

In templates using base template

{% extends 'gentelella/base.html' %}

Take a look this file to note the template block that you can overwrite

widgets

There are several widgets implemented this is a list of what you can use

  • TextInput

  • NumberInput

  • EmailInput

  • URLInput

  • PasswordInput

  • Textarea

  • TextareaWysiwyg (not working yet)

  • DateInput

  • DateTimeInput

  • TimeInput

  • CheckboxInput

  • YesNoInput

  • Select (jquery select2)

  • SelectMultiple (jquery select2)

  • SelectTail

  • SelectMultipleTail

  • RadioSelect

  • NullBooleanSelect

  • CheckboxSelectMultiple

  • SplitDateTimeWidget (not ready)

  • SplitHiddenDateTimeWidget (not ready)

  • SelectDateWidget (not ready)

  • PhoneNumberMaskInput

  • DateMaskInput

  • DateTimeMaskInput

  • EmailMaskInput

  • DateRangeTimeInput

  • DateRangeInput

  • AutocompleteSelect

  • AutocompleteSelectMultiple

  • Formset implementation

  • Remote select2 views.

Run the demo

cd demo
python manage.py migrate
python manage.py createdemo
python manage.py demomenu
python manage.py createsuperuser

And More see demo app.

Notes for development

base.js is autogenerated so you need to call

python manage.py createbasejs

Remember update the package version before make deploy it on server.

Project details


Release history Release notifications | RSS feed

This version

0.2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djgentelella-0.2.0.tar.gz (3.4 MB view details)

Uploaded Source

File details

Details for the file djgentelella-0.2.0.tar.gz.

File metadata

  • Download URL: djgentelella-0.2.0.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for djgentelella-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ef9ff3819709c047936e19da6bb02baad432f8e797fdc6a63242e3efb576182e
MD5 bbfc6f30e5ee5c7a6a0b88a0a9e01ef7
BLAKE2b-256 c830bcd52d7b54a7f876f1b7fb1bcf2b2a031fb09a5a41a3b743e892ea0e5ddd

See more details on using hashes here.

Supported by

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