Refactored CSV export logic

This commit is contained in:
Jeremy Stretch
2018-02-02 11:34:31 -05:00
parent df10fa87d3
commit 59dcbce417
9 changed files with 123 additions and 97 deletions

View File

@@ -7,7 +7,6 @@ from django.utils.encoding import python_2_unicode_compatible
from extras.models import CustomFieldModel, CustomFieldValue
from utilities.models import CreatedUpdatedModel
from utilities.utils import csv_format
@python_2_unicode_compatible
@@ -53,9 +52,9 @@ class Tenant(CreatedUpdatedModel, CustomFieldModel):
return reverse('tenancy:tenant', args=[self.slug])
def to_csv(self):
return csv_format([
return (
self.name,
self.slug,
self.group.name if self.group else None,
self.description,
])
)