first commit for v0.2
This commit is contained in:
parent
6ba03afc73
commit
1463854a45
143 changed files with 20775 additions and 2764 deletions
44
tracker/forms.py
Normal file
44
tracker/forms.py
Normal file
|
@ -0,0 +1,44 @@
|
|||
from django import forms
|
||||
|
||||
from bootstrap3_datetime.widgets import DateTimePicker
|
||||
from django_markdown.widgets import MarkdownWidget
|
||||
|
||||
from tracker.models import *
|
||||
|
||||
|
||||
__all__ = [
|
||||
'ProjectForm', 'LabelForm', 'IssueForm', 'MilestoneForm', 'CommentForm'
|
||||
]
|
||||
|
||||
|
||||
class ProjectForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Project
|
||||
fields = ['display_name', 'name', 'description', 'access']
|
||||
help_texts = {
|
||||
'name': 'Warning: if you change this value, this will break existing URLs.'
|
||||
}
|
||||
|
||||
|
||||
class IssueForm(forms.Form):
|
||||
title = forms.CharField(max_length=128)
|
||||
description = forms.CharField(widget=MarkdownWidget, required=False)
|
||||
|
||||
|
||||
class CommentForm(forms.Form):
|
||||
comment = forms.CharField(widget=MarkdownWidget)
|
||||
|
||||
|
||||
class LabelForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Label
|
||||
fields = ['name', 'color', 'inverted']
|
||||
|
||||
|
||||
class MilestoneForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Milestone
|
||||
fields = ['name', 'due_date']
|
||||
widgets = {
|
||||
'due_date': DateTimePicker(format="%Y-%m-%d %H:%M"),
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue