2019-12-24 17:28:41 +01:00
|
|
|
from django.forms import ModelForm
|
|
|
|
|
|
|
|
from c3nav.mapdata.forms import I18nModelFormMixin
|
|
|
|
from c3nav.mapdata.models.report import Report
|
|
|
|
|
|
|
|
|
|
|
|
class ReportIssueForm(I18nModelFormMixin, ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = Report
|
|
|
|
fields = ['title', 'description']
|
|
|
|
|
|
|
|
|
|
|
|
class ReportMissingLocationForm(I18nModelFormMixin, ModelForm):
|
2019-12-24 18:47:07 +01:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
self.fields['created_groups'].label_from_instance = lambda obj: obj.title
|
|
|
|
|
2019-12-24 17:28:41 +01:00
|
|
|
class Meta:
|
|
|
|
model = Report
|
|
|
|
fields = ['title', 'description', 'created_title', 'created_groups']
|