-Copyright (c) 2008, Michael Elsdörfer <http://elsdoerfer.name>
+Copyright (c) 2008, Michael Elsdörfer <http://elsdoerfer.name>
All rights reserved.
Redistribution and use in source and binary forms, with or without
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
+POSSIBILITY OF SUCH DAMAGE.
-include README\r
-include LICENSE\r
-include MANIFEST.in\r
-recursive-include tests *.py
\ No newline at end of file
+include README
+include LICENSE
+include MANIFEST.in
+recursive-include tests *.py
-django-tables - a Django QuerySet renderer.\r
-\r
-Documentation:\r
- http://elsdoerfer.name/docs/django-tables/\r
+django-tables - a Django QuerySet renderer.
+
+Documentation:
+ http://elsdoerfer.name/docs/django-tables/
correct filter class;
If not using django-filter, we wouldn't have different filter types; filters
-would just hold the data, and each column would know how to apply it.
\ No newline at end of file
+would just hold the data, and each column would know how to apply it.
from memory import *
from models import *
from columns import *
-from options import *
\ No newline at end of file
+from options import *
-"""
+"""
Allows setting/changing/removing of chosen url query string parameters,
while maintaining any existing others.
raise template.TemplateSyntaxError, "Argument syntax wrong: should be key=value"
return SetUrlParamNode(qschanges)
-register.tag('set_url_param', do_seturlparam)
\ No newline at end of file
+register.tag('set_url_param', do_seturlparam)
pass
class NumberColumn(Column):
- pass
\ No newline at end of file
+ pass
# raised instead.
class DefaultOptions(object):
IGNORE_INVALID_OPTIONS = True
-options = DefaultOptions()
\ No newline at end of file
+options = DefaultOptions()
:maxdepth: 1
ordering
- pagination
\ No newline at end of file
+ pagination
is not necessary to use Django's ``QuerySetPaginator`` with model tables.
Since the table knows that it holds a queryset, it will automatically choose
to use count() to determine the data length (which is exactly what
-``QuerySetPaginator`` would do).
\ No newline at end of file
+``QuerySetPaginator`` would do).
----------------------
The test suite uses nose:
- http://somethingaboutorange.com/mrl/projects/nose/
\ No newline at end of file
+ http://somethingaboutorange.com/mrl/projects/nose/
MemoryTable - uses dicts as the data source <memory>
ModelTable - wraps around a Django Model <models>
- SqlTable - is based on a raw SQL query <sql>
\ No newline at end of file
+ SqlTable - is based on a raw SQL query <sql>
Similarily, the colunn default value may also be callable that will take
the row instance as an argument (representing the row that the default is
-needed for).
\ No newline at end of file
+needed for).
options), they will generally be run when a row is accessed, and
possible repeatedly when accessed more than once. This behavior differs from
memory tables, where they would be called once, when the table is
-generated.
\ No newline at end of file
+generated.
ensure that pagination and sorting options are properly reflected in the
query.
-**Currently not implemented yet.**
\ No newline at end of file
+**Currently not implemented yet.**
# make django-tables available for import for tests
import os, sys
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
\ No newline at end of file
+sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
assert books.page.has_next() == True
# exceptions are converted into 404s
assert_raises(Http404, books.paginate, Paginator, 10, page=9999)
- assert_raises(Http404, books.paginate, Paginator, 10, page="abc")
\ No newline at end of file
+ assert_raises(Http404, books.paginate, Paginator, 10, page="abc")
books.order_by = 'id,-pages'
assert [c.is_ordered for c in books.columns] == [True, False, True, False]
assert [c.is_ordered_reverse for c in books.columns] == [False, False, True, False]
- assert [c.is_ordered_straight for c in books.columns] == [True, False, False, False]
\ No newline at end of file
+ assert [c.is_ordered_straight for c in books.columns] == [True, False, False, False]
assert len(connection.queries)-start_querycount == 2
# reset
- settings.DEBUG = False
\ No newline at end of file
+ settings.DEBUG = False
-"""Test template specific functionality.
+"""Test template specific functionality.
Make sure tables expose their functionality to templates right. This
generally about testing "out"-functionality of the tables, whether
-"""Empty demo app our tests can assign models to."""
\ No newline at end of file
+"""Empty demo app our tests can assign models to."""