Icon Picker for admin panel In Django
Project description
Django Material Icon Picker Widget
How to start:
pip install django-material-icons
Include it in the settings (Installed apps):
INSTALLED_APPS = [
...
'django.contrib.staticfiles',
'icon_picker_widget', #<----
...
Add static path files of widget to settings.py:
STATICFILES_DIRS = [
('icon_picker_widget',os.path.join(BASE_DIR, 'icon_picker_widget/static'))
]
Example of Usage:
model.py:
from django.db import models
class BlogPost(models.Model):
name = models.TextField()
icon = models.TextField()
admin.py
from django import forms
from django.contrib import admin
from icon_picker_widget.widgets import IconPickerWidget
from .models import BlogPost
class BlogPostAdminForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(BlogPostAdminForm, self).__init__(*args, **kwargs)
self.fields['icon'].widget = IconPickerWidget()
class BlogPostAdmin(admin.ModelAdmin):
form = BlogPostAdminForm
admin.site.register(BlogPost, BlogPostAdmin)
Acknowledgements
This widget wraps npick, a no-frills, no-fuss javascript icon picker.
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
Built Distributions
File details
Details for the file django-material-icon-widget-0.1.1.tar.gz
.
File metadata
- Download URL: django-material-icon-widget-0.1.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2271d9d7299f788d5b295c350bdee127239b39909d0b7ba74d408d47e39b577 |
|
MD5 | 001538cf88858519518d11cbada639d5 |
|
BLAKE2b-256 | e2f08f40fb30bac3d39059b1ee531864364a3bc02e45a11b23f9ab32e0e28ae5 |
Provenance
File details
Details for the file django_material_icon_widget-0.1.1-py3.6.egg
.
File metadata
- Download URL: django_material_icon_widget-0.1.1-py3.6.egg
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35b7ac15f61089b488c89ab54cd89308a79ff1b9eac9a497c3dda74e26baa328 |
|
MD5 | 0a9f3b72517a867cf81ea54679472974 |
|
BLAKE2b-256 | 0d945d2df1642859ec5808ac2b079fba5e77ffb0c07a7ed3c0147ba80d92c64d |
Provenance
File details
Details for the file django_material_icon_widget-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: django_material_icon_widget-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7b7191f33a5cfcc87730350c49e8e46d168a26caf0517080e75d0b6bf37e9c0 |
|
MD5 | 5bd0039999ffb6095d196584d76b7767 |
|
BLAKE2b-256 | aae0413d585d86b2e4562006354f419cd140b8a7d1fd62d55197b3a736d60df9 |