jazzband / django-smart-selects

chained and grouped selects for django forms
https://django-smart-selects.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.12k stars 352 forks source link

Fix issue #212. #223

Closed erozqba closed 7 years ago

erozqba commented 7 years ago

Fix issue #212

Load javascript for horizontal mode after ours javascript files because the horizontal mode javascript files will change the template and remove the class ".chained" that is used to initialize the element.

When using the horizontal mode, clean the cache in fill_field to avoid the duplication of elements.

How to validate:

diff --git a/test_app/models.py b/test_app/models.py
index a6900af..9d2abff 100644
--- a/test_app/models.py
+++ b/test_app/models.py
@@ -70,6 +70,7 @@ class Book(models.Model):
         Writer,
         chained_field="publication",
         chained_model_field="publications",
+        horizontal=True,
         )
     name = models.CharField(max_length=255)
coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 88.696% when pulling 7d84ccb86c496e6fe5ace837f4a508709205e43a on erozqba:issue_212 into 7a5327ed4e1c4981f1e1be2d5452b427e5e09724 on digi604:master.

blag commented 7 years ago

Thanks!