Django UI
Dynamic fields and settings theme color admin
Conditional fields show/hidden
- Show or hidden fields
- Changed color theme admin app
- Preview of images in forms
Version Python: ^3
Version django: ^2.2
Installation
pip install django_ui- Add of first
django_uito your installed apps - Run migrations
./ manage.py migrations
Usage (Show or hidden fields)
Conditional choice
- Add the class
{name_choice} j__{key_choice}to the trigger element
Conditional Checkbox
- Add the class
j__{name_bolean}to the trigger element
To use, create the forms.py file and add the class created in ModelAdmin
Example choice: {name_choice} j__{key_choice}
forms.py
from django import forms
class ModelExampleForm(forms.ModelForm):
occupation = forms.ChoiceField(choices=[
('study', 'Study'),
('work', 'Work')
], )
study = forms.CharField(label='Name Institution', required=False,
widget=forms.TextInput(attrs={'class': "occupation j__study"}))
semester = forms.CharField(label='Semester', required=False,
widget=forms.TextInput(attrs={'class': "occupation j__study"}))
company = forms.CharField(required=False,
widget=forms.TextInput(attrs={'class': "occupation j__work"}))
position = forms.CharField(required=False,
widget=forms.TextInput(attrs={'class': "occupation j__work"}))
admin.py
from django.contrib import admin
from your_app.forms import ModelExampleForm
from your_app.models import ModelExample
class ModelExampleAdmin(admin.ModelAdmin):
model = ModelExample
form = ModelExampleForm
\
Example checkbox: j__{name_bolean}
from django import forms
class ModelExampleForm(forms.ModelForm):
...
nick = forms.BooleanField(required=False, label='Add NickName?', help_text='Select if you want to add NickName',
widget=forms.CheckboxInput())
nickname = forms.CharField(required=False, widget=forms.TextInput(attrs={'class': "j__nick"}))
NOTE: In the form just add the fields you want to be dynamic
Preview
Usage (Show or hidden fields)
- Create as many themes as you want and activate the one you want
Example of image file
- Preview of images in forms
By default app hidden:
-
Show model example:
In settings create var
DJANGO_UI_SHOW_MODEL_EXAMPLE_DYNAMIC = True -
Use model theme:
In settings create var
USE_APP_THEME_UI_ADMIN = True
Made with ♥ by Jose Florez
Metadata
Release files for django-ui 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_ui-1.2.1.tar.gz | 9.5 kB | Without provenance | Details for django_ui-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_ui-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for django_ui-1.2.1-py3-none-any.whl |
Total release size: 20.5 kB
Release files / django_ui-1.2.1.tar.gz
| Download URL | django_ui-1.2.1.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4afafe979ad46eedff96e075f76fd19ae70713e4abaddaf3593b7009a0ca7a0
|
|
BLAKE2b-256 checksum How to use checksums |
c957c4c3792b413719c5151c61366d85f433af2b035c75b78d74d7461a6bcb36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5
|
Release files / django_ui-1.2.1-py3-none-any.whl
| Download URL | django_ui-1.2.1-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d250566b7e96f90c2857dc2dcd81eabbce24f6c98a80fa26ce7d24af319b2c49
|
|
BLAKE2b-256 checksum How to use checksums |
3314c2cc6de920506a72ec0991f32b09a290cf6d70e4bc3664f5595d5e829e38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5
|
Security for django-ui 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.