Ejemplo n.º 1
0
    def change_view(self, request, object_id, *args, **kwargs):
        obj = self.get_object(request, unquote(object_id))
        opts = self.model._meta

        headers = obj.submissions.get_formfield_labels()
        rows = obj.submissions.as_ordered_dictionaries(headers.keys())
        return render(
            request, 'admin/form_builder/form/change_form.html', {
                'title':
                _('View %s submissions') % force_text(opts.verbose_name),
                'object_id':
                object_id,
                'original':
                obj,
                'is_popup':
                "_popup" in request.REQUEST,
                'app_label':
                opts.app_label,
                'headers':
                headers,
                'rows':
                rows,
                'csv_file_name':
                self.csv_file_name(obj),
                'download_url':
                reverse('admin:{0}'.format(self.download_url_name),
                        args=[object_id])
            })
Ejemplo n.º 2
0
 def class_to_json(cls, site):
     """
     :Returns: a json-able python object that represents the class type.
     """
     return {
         '__class__': "%s.%s" % (cls._meta.app_label, cls._meta.module_name),
         'title': capfirst(cls._meta.verbose_name),
         'css_classes': (cls._meta.app_label, cls._meta.module_name),
         'tooltip': cls.tooltip and force_text(cls.tooltip),
     }
Ejemplo n.º 3
0
 def class_to_json(cls, site):
     """
     :Returns: a json-able python object that represents the class type.
     """
     return {
         '__class__':
         "%s.%s" % (cls._meta.app_label, cls._meta.module_name),
         'title': capfirst(cls._meta.verbose_name),
         'css_classes': cls.get_class_css_classes(),
         'tooltip': cls.tooltip and force_text(cls.tooltip),
     }
Ejemplo n.º 4
0
    def change_view(self, request, object_id, *args, **kwargs):
        obj = self.get_object(request, unquote(object_id))
        opts = self.model._meta

        headers = obj.submissions.get_formfield_labels()
        rows = obj.submissions.as_ordered_dictionaries(headers.keys())
        return render(request, 'admin/form_builder/form/change_form.html', {
            'title': _('View %s submissions') % force_text(opts.verbose_name),
            'object_id': object_id,
            'original': obj,
            'is_popup': "_popup" in request.REQUEST,
            'app_label': opts.app_label,
            'headers': headers,
            'rows': rows,
            'csv_file_name': self.csv_file_name(obj),
        })