Skip to content

Commit

Permalink
Select2Multiple -> ModelSelect2Multiple does the trick!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Dec 29, 2023
1 parent db773b4 commit 016fee0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
34 changes: 17 additions & 17 deletions archiv/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,27 @@ class HapaPlaceNameListFilter(django_filters.FilterSet):
url="gn_places-ac:geonamesplace-autocomplete",
),
)
# beleg = django_filters.ModelMultipleChoiceFilter(
# queryset=HapaBeleg.objects.all(),
# help_text=HapaPlaceName._meta.get_field("beleg").help_text,
# label=HapaPlaceName._meta.get_field("beleg").verbose_name,
# widget=autocomplete.Select2Multiple(
# url="archiv-ac:hapabeleg-autocomplete",
# ),
# )
# beleg__zotero_id = django_filters.ModelMultipleChoiceFilter(
# queryset=ZotItem.objects.all(),
# help_text="Bibliographischer Eintrag",
# label="Bibliographischer Eintrag",
# widget=autocomplete.Select2Multiple(
# url="bib:zotitem-autocomplete",
# ),
# )
beleg = django_filters.ModelMultipleChoiceFilter(
queryset=HapaBeleg.objects.all(),
help_text=HapaPlaceName._meta.get_field("beleg").help_text,
label=HapaPlaceName._meta.get_field("beleg").verbose_name,
widget=autocomplete.ModelSelect2Multiple(
url="archiv-ac:hapabeleg-autocomplete",
),
)
beleg__zotero_id = django_filters.ModelMultipleChoiceFilter(
queryset=ZotItem.objects.all(),
help_text="Bibliographischer Eintrag",
label="Bibliographischer Eintrag",
widget=autocomplete.ModelSelect2Multiple(
url="bib:zotitem-autocomplete",
),
)
orig_sprache = django_filters.ModelMultipleChoiceFilter(
queryset=SkosConcept.objects.filter(collection__name="orig_sprache"),
help_text=HapaPlaceName._meta.get_field("orig_sprache").help_text,
label=HapaPlaceName._meta.get_field("orig_sprache").verbose_name,
widget=autocomplete.Select2Multiple(
widget=autocomplete.ModelSelect2Multiple(
url="archiv-ac:orig-sprache",
attrs={
"data-placeholder": "Autocomplete ...",
Expand Down
4 changes: 2 additions & 2 deletions archiv/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def __init__(self, *args, **kwargs):
"etymology",
"syntax",
"comment",
# "beleg",
# 'beleg__zotero_id',
"beleg",
"beleg__zotero_id",
css_id="etym",
),
AccordionGroup(
Expand Down
2 changes: 1 addition & 1 deletion archiv/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def get_edit_url(self):
def get_next(self):
next = next_in_order(self)
if next:
return reverse("archiv:hapabeleg_detail", kwargs={"pk": next.id()})
return reverse("archiv:hapabeleg_detail", kwargs={"pk": next.id})
return False

def get_prev(self):
Expand Down
1 change: 0 additions & 1 deletion djangobaseproject/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
path("vocabs/", include("vocabs.urls", namespace="vocabs")),
path("vocabs-ac/", include("vocabs.dal_urls", namespace="vocabs-ac")),
path("", include("webpage.urls", namespace="webpage")),
path("__debug__/", include("debug_toolbar.urls")),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

handler404 = "webpage.views.handler404"
1 change: 1 addition & 0 deletions webpage/templates/webpage/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<link rel="stylesheet" id="fundament-styles" href="{{ SHARED_URL }}fundament/dist/fundament/css/fundament.min.css" type="text/css"/>
<link rel="stylesheet" href="{% static 'webpage/css/style.css' %}" rel="stylesheet"/>
<link rel="stylesheet" href="{{ SHARED_URL }}apis/libraries/scroll-to-top/css/ap-scroll-top.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
<style>
@font-face {
font-family: 'myFirstFont';
Expand Down

0 comments on commit 016fee0

Please sign in to comment.