website/conservancy/usethesource/forms.py

20 lines
758 B
Python
Raw Normal View History

from django import forms
from .models import Comment
class CommentForm(forms.ModelForm):
post_to_list = forms.BooleanField(required=False)
class Meta:
model = Comment
fields = ['time', 'attribute_to', 'message', 'post_to_list']
2024-01-31 23:05:11 +00:00
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['time'].widget.input_type = 'datetime-local'
class DownloadForm(forms.Form):
agree = forms.BooleanField(label="I promise and represent that I will not copy, distribute, modify, or otherwise use this source code candidate and/or firmware for any purpose other than to help SFC evaluate the source code candidate for compliance with the terms of the GNU General Public License (any version).")