Converted circuits import views to new scheme

This commit is contained in:
Jeremy Stretch
2017-06-02 13:40:52 -04:00
parent cac3d5a6e6
commit 83a50f45b5
10 changed files with 57 additions and 135 deletions

View File

@@ -36,10 +36,12 @@ class TenantForm(BootstrapMixin, CustomFieldForm):
class TenantCSVForm(forms.ModelForm):
slug = SlugField()
group = forms.ModelChoiceField(
queryset=TenantGroup.objects.all(),
required=False,
to_field_name='name',
help_text='Name of parent group',
error_messages={
'invalid_choice': 'Group not found.'
}
@@ -48,6 +50,10 @@ class TenantCSVForm(forms.ModelForm):
class Meta:
model = Tenant
fields = ['name', 'slug', 'group', 'description', 'comments']
help_texts = {
'name': 'Tenant name',
'comments': 'Free-form comments'
}
class TenantBulkEditForm(BootstrapMixin, CustomFieldBulkEditForm):