app/soc/views/models/base.py
changeset 1398 e6a11f0dba68
parent 1373 178bd19966fe
child 1399 5b154edd94ac
equal deleted inserted replaced
1397:c63de68dadec 1398:e6a11f0dba68
   221     context['entity_type'] = params['name']
   221     context['entity_type'] = params['name']
   222 
   222 
   223     template = params['export_template']
   223     template = params['export_template']
   224 
   224 
   225     response_args = {'mimetype': params['export_content_type']}
   225     response_args = {'mimetype': params['export_content_type']}
       
   226     response_headers = {
       
   227         'Content-Disposition': 'attachment; filename=%s.txt' % entity.link_id,
       
   228         }
   226 
   229 
   227     return helper.responses.respond(request, template, context=context,
   230     return helper.responses.respond(request, template, context=context,
   228                                     response_args=response_args)
   231                                     response_args=response_args,
       
   232                                     response_headers=response_headers)
   229 
   233 
   230   @decorators.check_access
   234   @decorators.check_access
   231   def create(self, request, access_type,
   235   def create(self, request, access_type,
   232              page_name=None, params=None, **kwargs):
   236              page_name=None, params=None, **kwargs):
   233     """Displays the create page for this entity type.
   237     """Displays the create page for this entity type.