Giter Club home page Giter Club logo

django-faicon's People

Contributors

dantium avatar helllllllder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

django-faicon's Issues

TypeError: load() missing 1 required positional argument: 'Loader'

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'

Support for wagtail and some small issues.

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...
image
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.
image
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.
image

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...

Warning for YAML loading

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)

How to render icon field inside form?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.