bookwyrm/bookwyrm/forms/author.py

53 lines
1.8 KiB
Python
Raw Permalink Normal View History

2022-03-14 18:46:08 +00:00
""" using django model forms """
from django import forms
from bookwyrm import models
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class AuthorForm(CustomForm):
class Meta:
model = models.Author
fields = [
"last_edited_by",
"name",
"aliases",
"bio",
"wikipedia_link",
2024-02-03 22:55:33 +00:00
"wikidata",
2023-01-15 08:41:39 +00:00
"website",
2022-03-14 18:46:08 +00:00
"born",
"died",
"openlibrary_key",
"inventaire_id",
"librarything_key",
"goodreads_key",
"isfdb",
2022-03-14 18:46:08 +00:00
"isni",
]
widgets = {
"name": forms.TextInput(attrs={"aria-describedby": "desc_name"}),
"aliases": forms.TextInput(attrs={"aria-describedby": "desc_aliases"}),
"bio": forms.Textarea(attrs={"aria-describedby": "desc_bio"}),
"wikipedia_link": forms.TextInput(
attrs={"aria-describedby": "desc_wikipedia_link"}
),
2024-02-03 22:55:33 +00:00
"wikidata": forms.TextInput(attrs={"aria-describedby": "desc_wikidata"}),
2023-01-15 08:41:39 +00:00
"website": forms.TextInput(attrs={"aria-describedby": "desc_website"}),
2022-03-14 18:46:08 +00:00
"born": forms.SelectDateWidget(attrs={"aria-describedby": "desc_born"}),
"died": forms.SelectDateWidget(attrs={"aria-describedby": "desc_died"}),
"openlibrary_key": forms.TextInput(
attrs={"aria-describedby": "desc_openlibrary_key"}
2022-03-14 18:46:08 +00:00
),
"inventaire_id": forms.TextInput(
attrs={"aria-describedby": "desc_inventaire_id"}
),
"librarything_key": forms.TextInput(
attrs={"aria-describedby": "desc_librarything_key"}
),
"goodreads_key": forms.TextInput(
attrs={"aria-describedby": "desc_goodreads_key"}
),
}