text: import csv
  from django.http import HttpResponse
  
  def export_as_csv_action(description="Export selected objects as CSV file",
                           fields=None, exclude=None, header=True):
      """
      This function returns an export csv action
      'fields' and 'exclude' work like in django ModelForm
      'header' is whether or not to output the column names as the first row
      """
      def export_as_csv(modeladmin, request, queryset):
          """
          Generic csv export admin action.
          based on http://djangosnippets.org/snippets/1697/
          """
          opts = modeladmin.model._meta
          field_names = set([field.name for field in opts.fields])
          if fields:
              fieldset = set(fields)
              field_names = field_names & fieldset
          elif exclude:
              excludeset = set(exclude)
              field_names = field_names - excludeset
  
          response = HttpResponse(mimetype='text/csv')
          response['Content-Disposition'] = 'attachment; filename=%s.csv' % str(opts).replace('.', '_')
  
          writer = csv.DictWriter(response, fields)
          writer.writeheader()
  
          for obj in queryset:
              writer.writerow(dict(zip(fields, [getattr(obj, field) for field in fields])))
  
          return response
      export_as_csv.short_description = description
      return export_as_csv
  
  
  def int_to_date(date):
      OPCIONES_MES = (
          ("01", "Enero"),
          ("02", "Febrero"),
          ("03", "Marzo"),
          ("04", "Abril"),
          ("05", "Mayo"),
          ("06", "Junio"),
          ("07", "Julio"),
          ("08", "Agosto"),
          ("09", "Septiembre"),
          ("10", "Octubre"),
          ("11", "Noviembre"),
          ("12", "Diciembre")
      )
  
      for temp in OPCIONES_MES:
          if temp[0] == date:
              return temp[1]
  
      return None