dantium / django-faicon Goto Github PK
View Code? Open in Web Editor NEWDjango model field and admin icon picker for Font Awesome 5 Icons
License: MIT License
Django model field and admin icon picker for Font Awesome 5 Icons
License: MIT License
Whenever I want to import, migrate or do other stuff, I get this warning:
YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
data_loaded = yaml.load(stream)
Hello, @dantium! Could you please make your module working with Wagtail? Please, I love it, in Django it works perfectly without an issue! But in Wagtail there are some issues with JS, for example when you click on span
(add favicon) nothing happens. (If I manually add show
class to model, all of the model buttons works just fine, which is weird, only when you select any of the icon it shows that it cannot get val
of undefined, of course.)
I cant determine why only $('.faicon-add').on('click', function(){
won't work...
And you add jquery to the admin. Wagtail already uses jquery, so I think you need to check somehow if admin is Wagtail's admin and then whether or not load jquery.
And some issues with CSS in the model, of course because of Wagtail's css.
Other than that, everything works perfectly, only yaml was showing a warning \site-packages\faicon\models.py:23: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
I then changed yaml.load(stream)
on line 23 to yaml.safe_load(stream)
and there was no warning anymore.
And when you already have some objects in the database and want to edit it when there is no icon in the database in that object, wagtail shows an error.
Actually I was searching a lot for working django module for Font Awesome, and your is the best one!
And that's all I found while using it. Please, fix it. I will use it in all of my projects 100%! ๐ If you don't have time to work on that project, I can make a pull request, I think...
Added field in my model: category_icon = FAIconField()
And when I run python manage.py makemigrations this mistake is occurring:
Traceback (most recent call last):
File "/Users/apple/Desktop/desctop/pycharm/pythonProject/ukr_mobile/manage.py", line 22, in
main()
File "/Users/apple/Desktop/desctop/pycharm/pythonProject/ukr_mobile/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/Users/apple/Desktop/desctop/pycharm/pythonProject/venv/lib/python3.11/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/Users/apple/Desktop/desctop/pycharm/pythonProject/venv/lib/python3.11/site-packages/django/core/management/init.py", line 420, in execute
django.setup()
File "/Users/apple/Desktop/desctop/pycharm/pythonProject/venv/lib/python3.11/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/apple/Desktop/desctop/pycharm/pythonProject/venv/lib/python3.11/site-packages/django/apps/registry.py", line 116, in populate
app_config.import_models()
File "/Users/apple/Desktop/desctop/pycharm/pythonProject/venv/lib/python3.11/site-packages/django/apps/config.py", line 269, in import_models
self.models_module = import_module(models_module_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/apple/Desktop/desctop/pycharm/pythonProject/venv/lib/python3.11/site-packages/faicon/models.py", line 43, in
ICON_LIST = get_icon_list()
^^^^^^^^^^^^^^^
File "/Users/apple/Desktop/desctop/pycharm/pythonProject/venv/lib/python3.11/site-packages/faicon/models.py", line 23, in get_icon_list
data_loaded = yaml.load(stream)
^^^^^^^^^^^^^^^^^
TypeError: load() missing 1 required positional argument: 'Loader'
I have a form like:
from faicon.fields import FAIconField
class SomeForm(forms.Form):
icon = FAIconField()
And I render the field as
{{ form.icon }}
But instead a real icon field I see on webpage:
<faicon.fields.FAIconField>
What is a proper way to render icon field outside admin?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.