Skip to content

Commit

Permalink
Update requirements and supported versions, bump version.
Browse files Browse the repository at this point in the history
git-svn-id: https://projects.ninemoreminutes.com/svn/django-datatables/trunk@46 d7121a62-6ae3-45d9-917d-ff5cd7ed6f65
  • Loading branch information
chris authored and cchurch committed Aug 30, 2014
1 parent 8d8db6d commit 35075af
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 62 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013 Nine More Minutes, Inc.
Copyright (c) 2014 Nine More Minutes, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 5 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
The Django DataTables library provides a reusable Django application to easily
integrate the DataTables jQuery plugin into a project.

It is currently in the design and planning stage.
It is currently considered an alpha release. It works for me for a few
projects, but may not be ready for your production application. The classes,
functions and parameters are subject to change in future releases.

It is tested against Python 2.6 and Python 2.7 using Django 1.4, 1.5 and 1.6.

To get started with the test_project, use the following commands to setup your
test database and run the development server:
Expand Down
2 changes: 1 addition & 1 deletion datatables/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.2a0'
__version__ = '0.2a1'

from columns import *
from datatable import *
Expand Down
5 changes: 0 additions & 5 deletions datatables/columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ def render_value(self, row, bc):

class ExpandableColumn(Column):

#class Media:
# js = ('datatables/expandablecolumn.js',)

def __init__(self, **kwargs):
self.close_image = kwargs.pop('close_image', None)
self.open_image = kwargs.pop('open_image', None)
Expand All @@ -125,8 +122,6 @@ def __init__(self, **kwargs):

def render_label(self, bound_column):
return ''
#return mark_safe(u'<img class="datatables_expand" src="%s" />'
# % (self.open_image))

def render_value(self, row, bound_column):
return mark_safe('<img class="datatables_expand" src="%s" />'
Expand Down
6 changes: 3 additions & 3 deletions datatables/datatable.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def extra_js(self):
try:
extra += column.column.render_javascript(self.var, column)
except Exception, e:
#print e
# FIXME: Log exception as warning?
pass
return mark_safe(extra)

Expand Down Expand Up @@ -319,10 +319,10 @@ def handle_ajax(self, request):
'iTotalRecords': iTotalRecords,
'iTotalDisplayRecords': iTotalDisplayRecords,
'sEcho': params.get('sEcho', ''),
#'sColumns': ,
# 'sColumns': ,
'aaData': aaData,
}
#print qs.query
# print qs.query
s = dumpjs(data)
return HttpResponse(s, content_type='application/json')

Expand Down
40 changes: 20 additions & 20 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# MacOS with Python 2.6.6 from python.org may need to use tox==1.4.2 with
# PIP Requirements File (for a development/build environment)
# MacOS with Python 2.6.6 from python.org may need to use tox==1.4.2 with
# virtualenv==1.8.2 and pip==1.2.1 instead.
argparse==1.2.1
coverage==3.7
coverage==3.7.1
decorator==3.4.0
distribute==0.7.3
django-debug-toolbar==0.11.0
django-devserver==0.7.0
django-extensions==1.2.5
django-debug-toolbar==1.2.1
django-devserver==0.8.0
django-extensions==1.3.11
django-fortunecookie==0.1.5
django-setuptest==0.1.4
django-sortedm2m==0.6.0
Django==1.6
docutils==0.11
ipython==1.1.0
Jinja2==2.7.1
MarkupSafe==0.18
pep8==1.4.6
pip-tools==0.3.4
py==1.4.18
django-sortedm2m==0.8.0
Django==1.6.6
docutils==0.12
ipython==2.2.0
Jinja2==2.7.3
MarkupSafe==0.23
pep8==1.5.7
pip-tools==0.3.5
py==1.4.23
Pygments==1.6
six==1.4.1
South==0.8.4
Sphinx==1.2
sqlparse==0.1.10
tox==1.6.1
virtualenv==1.10.1
six==1.7.3
South==1.0
Sphinx==1.2.2
sqlparse==0.1.11
tox==1.7.1
virtualenv==1.11.6
12 changes: 6 additions & 6 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# PIP Requirements File (for automated testing with Tox, excludes Django)
argparse==1.2.1
coverage==3.7
coverage==3.7.1
decorator==3.4.0
distribute==0.7.3
django-debug-toolbar==0.11.0
django-devserver==0.7.0
django-extensions==1.2.5
django-debug-toolbar==1.2.1
django-devserver==0.8.0
django-extensions==1.3.11
django-fortunecookie==0.1.5
django-setuptest==0.1.4
django-sortedm2m==0.6.0
South==0.8.4
django-sortedm2m==0.8.0
South==1.0
2 changes: 1 addition & 1 deletion test_app/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def setUp(self):
super(TestDataTables, self).setUp()
# For test coverage.
imp.reload(sys.modules['datatables.columns'])
#imp.reload(sys.modules['datatables.datatable'])
# imp.reload(sys.modules['datatables.datatable'])
imp.reload(sys.modules['datatables.decorators'])
imp.reload(sys.modules['datatables.utils'])

Expand Down
26 changes: 13 additions & 13 deletions test_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class FortuneCookieTable(datatables.DataTable):

#pk = datatables.CheckboxColumn()
# pk = datatables.CheckboxColumn()
fortune = datatables.Column(
label='Your Fortune',
sort_field='fortune_lower',
Expand All @@ -34,7 +34,7 @@ class FortuneCookieTable(datatables.DataTable):
sort_field='chinese_word.english_word',
search_field='chinese_word.english_word',
sClass='okie',
#bSearchable=False,
# bSearchable=False,
)

def get_queryset(self):
Expand All @@ -53,17 +53,17 @@ class Meta:
sScrollY = '200px'
aaSorting = [[2, "desc"]]
aLengthMenu = [[3, 10, 25, 50, -1], [3, 10, 25, 50, "All"]]
#fnInitComplete = '''function(oSettings, json) {
# alert("Init Complete!"); }'
#bServerSide = True
#sAjaxSource = '/'
#fnServerData = '''function( sUrl, aoData, fnCallback ) {
# $.ajax( {
# "url": sUrl,
# "data": aoData,
# "success": fnCallback,
# "dataType": "jsonp",
# "cache": false} );}'''
# fnInitComplete = '''function(oSettings, json) {
# alert("Init Complete!"); }'
# bServerSide = True
# sAjaxSource = '/'
# fnServerData = '''function( sUrl, aoData, fnCallback ) {
# $.ajax( {
# "url": sUrl,
# "data": aoData,
# "success": fnCallback,
# "dataType": "jsonp",
# "cache": false} );}'''


@datatables.datatable(FortuneCookieTable, name='fct')
Expand Down
42 changes: 41 additions & 1 deletion test_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
INTERNAL_IPS = ('127.0.0.1',)

DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
#'INTERCEPT_REDIRECTS': False,
}

DEVSERVER_DEFAULT_ADDR = '127.0.0.1'
Expand All @@ -80,3 +80,43 @@
)

SECRET_KEY = 'gkwl+r%+^4==^(dnnkv8o#&h&bn=x43*k$h7_e7p+l0w&eba)m'

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse',
}
},
'handlers': {
'console': {
'level': 'INFO',
'class': 'logging.StreamHandler',
},
'null': {
'class': 'django.utils.log.NullHandler',
},
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django': {
'handlers': ['console'],
},
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
'py.warnings': {
'handlers': ['console'],
},
'datatables': {
'handlers': ['console'],
}
}
}
20 changes: 10 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ downloadcache = {toxworkdir}/cache
[testenv:py26-dj14]
basepython = python2.6
deps =
Django==1.4.10
Django==1.4.14
{[testenv]deps}
setenv =
PIP_INSECURE = 1
Expand All @@ -28,13 +28,13 @@ setenv =
[testenv:py27-dj14]
basepython = python2.7
deps =
Django==1.4.10
Django==1.4.14
{[testenv]deps}

[testenv:py26-dj15]
basepython = python2.6
deps =
Django==1.5.5
Django==1.5.9
{[testenv]deps}
setenv =
PIP_INSECURE = 1
Expand All @@ -43,13 +43,13 @@ setenv =
[testenv:py27-dj15]
basepython = python2.7
deps =
Django==1.5.5
Django==1.5.9
{[testenv]deps}

[testenv:py32-dj15]
basepython = python3.2
deps =
Django==1.5.5
Django==1.5.9
{[testenv]deps}
setenv =
PYTHONDONTWRITEBYTECODE = 1
Expand All @@ -58,7 +58,7 @@ setenv =
[testenv:py33-dj15]
basepython = python3.3
deps =
Django==1.5.5
Django==1.5.9
{[testenv]deps}
setenv =
PYTHONDONTWRITEBYTECODE = 1
Expand All @@ -67,7 +67,7 @@ setenv =
[testenv:py26-dj16]
basepython = python2.6
deps =
Django==1.6
Django==1.6.6
{[testenv]deps}
setenv =
PIP_INSECURE = 1
Expand All @@ -76,13 +76,13 @@ setenv =
[testenv:py27-dj16]
basepython = python2.7
deps =
Django==1.6
Django==1.6.6
{[testenv]deps}

[testenv:py32-dj16]
basepython = python3.2
deps =
Django==1.6
Django==1.6.6
{[testenv]deps}
setenv =
PYTHONDONTWRITEBYTECODE = 1
Expand All @@ -91,7 +91,7 @@ setenv =
[testenv:py33-dj16]
basepython = python3.3
deps =
Django==1.6
Django==1.6.6
{[testenv]deps}
setenv =
PYTHONDONTWRITEBYTECODE = 1
Expand Down

0 comments on commit 35075af

Please sign in to comment.