From: Michael Elsdörfer Date: Wed, 24 Mar 2010 16:49:17 +0000 (+0100) Subject: Moved the global options to a separate module as well. X-Git-Tag: 0.2~23 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ba87df456c6bc4ae431d35f607c8410f89775812;p=django-tables2.git Moved the global options to a separate module as well. --- diff --git a/django_tables/__init__.py b/django_tables/__init__.py index 6a3916a..f32db84 100644 --- a/django_tables/__init__.py +++ b/django_tables/__init__.py @@ -1,4 +1,4 @@ from memory import * from models import * from columns import * -from base import * \ No newline at end of file +from options import * \ No newline at end of file diff --git a/django_tables/base.py b/django_tables/base.py index 8ab77be..37e5d56 100644 --- a/django_tables/base.py +++ b/django_tables/base.py @@ -5,6 +5,7 @@ from django.utils.datastructures import SortedDict from django.utils.encoding import StrAndUnicode from django.utils.text import capfirst from columns import Column +from options import options __all__ = ('BaseTable', 'options') @@ -161,16 +162,6 @@ class OrderByTuple(tuple, StrAndUnicode): ) -# A common use case is passing incoming query values directly into the -# table constructor - data that can easily be invalid, say if manually -# modified by a user. So by default, such errors will be silently -# ignored. Set the option below to False if you want an exceptions to be -# raised instead. -class DefaultOptions(object): - IGNORE_INVALID_OPTIONS = True -options = DefaultOptions() - - class BaseTable(object): """A collection of columns, plus their associated data rows. """ diff --git a/django_tables/options.py b/django_tables/options.py new file mode 100644 index 0000000..069a831 --- /dev/null +++ b/django_tables/options.py @@ -0,0 +1,18 @@ +"""Global module options. + +I'm not entirely happy about these existing at this point; maybe we can +get rid of them. +""" + + +__all__ = ('options',) + + +# A common use case is passing incoming query values directly into the +# table constructor - data that can easily be invalid, say if manually +# modified by a user. So by default, such errors will be silently +# ignored. Set the option below to False if you want an exceptions to be +# raised instead. +class DefaultOptions(object): + IGNORE_INVALID_OPTIONS = True +options = DefaultOptions() \ No newline at end of file