From 0d6c58947db3154504895c2c9f1ceb1adf4c2dcd Mon Sep 17 00:00:00 2001 From: "Chen, Chien-ting" Date: Sun, 31 Jan 2021 22:15:05 +0800 Subject: [PATCH] add nounform --- gazhdict/addentry/add_entry_form.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gazhdict/addentry/add_entry_form.py b/gazhdict/addentry/add_entry_form.py index fc74c47..7c5810a 100644 --- a/gazhdict/addentry/add_entry_form.py +++ b/gazhdict/addentry/add_entry_form.py @@ -21,6 +21,31 @@ class EntryForm(forms.ModelForm): 'PreScript': '前註', 'PostScript': '後註' } + +class NounForm(forms.ModelForm): + class Meta: + model = Meaning + fields = '__all__' + + widgets = { + 'Entry': forms.TextInput(attrs={'class': 'noun-form'}), + 'Gender': forms.NumberInput(attrs={'class': 'noun-form'}), + 'Decl_no': forms.NumberInput(attrs={'class': 'noun-form'}), + 'Gsg': forms.TextInput(attrs={'class': 'noun-form'}), + 'Npl': forms.TextInput(attrs={'class': 'noun-form'}), + 'Gpl': forms.TextInput(attrs={'class': 'noun-form'}), + 'Dsg': forms.TextInput(attrs={'class': 'noun-form'}), + } + + labels = { + 'Entry': '條目', + 'Gender': '性(0 代表質詞)', + 'Decl_no': '變格號碼', + 'Gsg': '單屬', + 'Npl': '複主', + 'Gpl': '複屬', + 'Dsg': '單與', + } class MeaningForm(forms.ModelForm): class Meta: