Django Solr(Filter) - Dropdown list for objects, how to implement? or adapt
📁 список, python, пример
There is a list of objects displayed by the value of product attributes.
Product attribute values that are related to each other should be in the form of a Select(option)/DropDownMenu dropdown list, i.e. - for example, instead of Size:Medium, Size:Small it should be just
MediumSmallThe fact that these attribute values belong to Size can be specified inside Templates(label), i.e. it's not that important, the main thing is how to put them into this Select list (Dropdown Menu).
I would like to add that I tried to change the values that are specified by default, in Templates, instead of CheckBoxes - I tried to specify Select Option, but the result was incorrect
.
TEMPLATES
Browse.html:
Answering your question: The __init__.py file was required in Python 2.X, but is no longer required, presumably starting from Python 3 and above.
Also adding: You can either not use __init__.py or leave it empty, in which case it will execute initialization code for the package or set the __all__ variable.
__init__.py files are necessary for Python to treat directories as containing packages; this is done to prevent directories with common names, such as string, from unintentionally hiding valid modules that appear later (deeper) in the module search path.
Log in to leave an answer