Update web/core/forms.py
This commit is contained in:
parent
a7a8d8cc74
commit
11911edeee
@ -1,4 +1,7 @@
|
||||
from django import forms
|
||||
from .models_ann import Announcement
|
||||
from django.forms import ModelForm, Textarea
|
||||
|
||||
|
||||
class ImportForm(forms.Form):
|
||||
file = forms.FileField(allow_empty_file=False)
|
||||
@ -57,3 +60,11 @@ class EntryForm(forms.Form):
|
||||
def clean_talk_number(self):
|
||||
v = self.cleaned_data.get("talk_number")
|
||||
return v if isinstance(v, int) else None
|
||||
|
||||
class AnnouncementForm(ModelForm):
|
||||
class Meta:
|
||||
model = Announcement
|
||||
fields = ["title", "message", "is_active", "start_at", "end_at"]
|
||||
widgets = {
|
||||
"message": Textarea(attrs={"rows": 6, "placeholder": "What’s new in this release…"}),
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user