mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 04:51:11 +00:00
Get the field working
This commit is contained in:
parent
716e357060
commit
a37f83c458
1 changed files with 9 additions and 3 deletions
|
@ -14,6 +14,14 @@ class CoverForm(CustomForm):
|
||||||
help_texts = {f: None for f in fields}
|
help_texts = {f: None for f in fields}
|
||||||
|
|
||||||
|
|
||||||
|
class ArrayWidget(forms.widgets.TextInput):
|
||||||
|
# pylint: disable=unused-argument
|
||||||
|
# pylint: disable=no-self-use
|
||||||
|
def value_from_datadict(self, data, files, name):
|
||||||
|
"""get all values for this name"""
|
||||||
|
return [i for i in data.getlist(name) if i]
|
||||||
|
|
||||||
|
|
||||||
class EditionForm(CustomForm):
|
class EditionForm(CustomForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.Edition
|
model = models.Edition
|
||||||
|
@ -41,12 +49,10 @@ class EditionForm(CustomForm):
|
||||||
"series_number": forms.TextInput(
|
"series_number": forms.TextInput(
|
||||||
attrs={"aria-describedby": "desc_series_number"}
|
attrs={"aria-describedby": "desc_series_number"}
|
||||||
),
|
),
|
||||||
|
"subjects": ArrayWidget(),
|
||||||
"languages": forms.TextInput(
|
"languages": forms.TextInput(
|
||||||
attrs={"aria-describedby": "desc_languages_help desc_languages"}
|
attrs={"aria-describedby": "desc_languages_help desc_languages"}
|
||||||
),
|
),
|
||||||
"subjects": forms.TextInput(
|
|
||||||
attrs={"aria-describedby": "desc_subjects"}
|
|
||||||
),
|
|
||||||
"publishers": forms.TextInput(
|
"publishers": forms.TextInput(
|
||||||
attrs={"aria-describedby": "desc_publishers_help desc_publishers"}
|
attrs={"aria-describedby": "desc_publishers_help desc_publishers"}
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue