Answer the question
In order to leave comments, you need to log in
How to properly design a custom widget in Django?
Faced a problem when writing widgets. Let me explain with an example. There is a certain color selector for fields. I'm adding a few of these selectors on a form. I initialize each with this piece of code:
...
$('#id_color_selector1').colorselector();
$('#id_color_selector2').colorselector();
$('#id_color_selector3').colorselector();
...
...
class Media:
js = (
'/static/colorwidget/js/my_color_widget.js',
)
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question