Permalink
Browse files

better export operations

  • Loading branch information...
joamag committed Dec 5, 2018
1 parent a7c3cea commit 567b41af1670efddc4cd435737f84dffe900eb3f
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/appier_extras/parts/admin/part.py
@@ -1144,8 +1144,13 @@ def bundle_locale_json(self, id):
locale = models.Locale.get(id = id, rules = False)
name = name or locale.context or "global"
file_name = "%s.%s.json" % (name, locale.locale)
self.content_disposition("filename=\"%s\"" % file_name)
return self.json(locale.data_j, sort_keys = True)
self.content_disposition("filename=\"%s\"" % file_name)
return self.json(
locale.data_j,
sort_keys = True,
indent = 4,
separators = (",", ": ")
)
@appier.ensure(token = "admin.database", context = "admin")
def database(self):
@@ -1169,7 +1174,7 @@ def database_export(self):
file_name = "%s_%s.dat" % (self.owner.name, date_time_s)
self.content_type("application/octet-stream")
self.content_disposition("attachment; filename=\"%s\"" % file_name)
self.content_disposition("attachment; filename=\"%s\"" % file_name)
return file.getvalue()

0 comments on commit 567b41a

Please sign in to comment.