From eecf978559e74d1203de4a068399d4f48b5ebcd3 Mon Sep 17 00:00:00 2001 From: Gary Wilson Jr Date: Tue, 17 Jul 2012 14:15:04 -0500 Subject: [PATCH 1/2] Added a Field class so that models using custom fields that inherit from Field don't cause an exception and don't require a value in the export form. --- export/fields.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/export/fields.py b/export/fields.py index 75f280e..e22eded 100644 --- a/export/fields.py +++ b/export/fields.py @@ -258,6 +258,14 @@ def filter(self, name, value, queryset): return queryset.filter(**kwargs) +class Field(forms.fields.Field): + def __init__(self, field, *args, **kwargs): + super(Field, self).__init__( + required=False, + *args, **kwargs) + ) + + class FileField(BasicTextField): pass From a6af447a257db6b1c082148cdb99e9a638b68509 Mon Sep 17 00:00:00 2001 From: Dhruv Baldawa Date: Tue, 16 Sep 2014 05:51:48 +0530 Subject: [PATCH 2/2] Remove extra ) causing syntax error --- export/fields.py | 1 - 1 file changed, 1 deletion(-) diff --git a/export/fields.py b/export/fields.py index e22eded..23dabdf 100644 --- a/export/fields.py +++ b/export/fields.py @@ -263,7 +263,6 @@ def __init__(self, field, *args, **kwargs): super(Field, self).__init__( required=False, *args, **kwargs) - ) class FileField(BasicTextField):