Now django.multiselectfield support Django 1.7
This commit is contained in:
parent
b3ea613558
commit
c9c7d07741
|
@ -90,4 +90,5 @@ a readily setup project that uses django-multiselectfield. You can run it as usu
|
||||||
::
|
::
|
||||||
|
|
||||||
python manage.py syncdb --noinput
|
python manage.py syncdb --noinput
|
||||||
|
python manage.py loaddata data
|
||||||
python manage.py runserver
|
python manage.py runserver
|
||||||
|
|
|
@ -23,6 +23,8 @@ from example.app.models import Book
|
||||||
|
|
||||||
class MultiSelectTestCase(TestCase):
|
class MultiSelectTestCase(TestCase):
|
||||||
|
|
||||||
|
fixtures = ['data.json']
|
||||||
|
|
||||||
def test_filter(self):
|
def test_filter(self):
|
||||||
self.assertEqual(Book.objects.filter(tags__contains='sex').count(), 1)
|
self.assertEqual(Book.objects.filter(tags__contains='sex').count(), 1)
|
||||||
self.assertEqual(Book.objects.filter(tags__contains='boring').count(), 0)
|
self.assertEqual(Book.objects.filter(tags__contains='boring').count(), 0)
|
||||||
|
|
|
@ -21,7 +21,7 @@ from os import path
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
|
|
||||||
BASEDIR = path.dirname(path.abspath(__file__))
|
BASE_DIR = path.dirname(path.abspath(__file__))
|
||||||
|
|
||||||
ADMINS = (
|
ADMINS = (
|
||||||
# ('Your Name', 'your_email@example.com'),
|
# ('Your Name', 'your_email@example.com'),
|
||||||
|
@ -70,7 +70,7 @@ USE_TZ = True
|
||||||
|
|
||||||
# Absolute filesystem path to the directory that will hold user-uploaded files.
|
# Absolute filesystem path to the directory that will hold user-uploaded files.
|
||||||
# Example: "/var/www/example.com/media/"
|
# Example: "/var/www/example.com/media/"
|
||||||
MEDIA_ROOT = path.join(BASEDIR, 'media')
|
MEDIA_ROOT = path.join(BASE_DIR, 'media')
|
||||||
|
|
||||||
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
||||||
# trailing slash.
|
# trailing slash.
|
||||||
|
@ -81,7 +81,7 @@ MEDIA_URL = '/media/'
|
||||||
# Don't put anything in this directory yourself; store your static files
|
# Don't put anything in this directory yourself; store your static files
|
||||||
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
|
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
|
||||||
# Example: "/var/www/example.com/static/"
|
# Example: "/var/www/example.com/static/"
|
||||||
STATIC_ROOT = path.join(BASEDIR, 'static')
|
STATIC_ROOT = path.join(BASE_DIR, 'static')
|
||||||
|
|
||||||
# URL prefix for static files.
|
# URL prefix for static files.
|
||||||
# Example: "http://example.com/static/", "http://static.example.com/"
|
# Example: "http://example.com/static/", "http://static.example.com/"
|
||||||
|
|
|
@ -30,7 +30,11 @@ if len(sys.argv) == 1:
|
||||||
else:
|
else:
|
||||||
os.environ[ENVIRONMENT_VARIABLE] = sys.argv[1]
|
os.environ[ENVIRONMENT_VARIABLE] = sys.argv[1]
|
||||||
|
|
||||||
if django.VERSION[0] == 1 and django.VERSION[1] <= 5:
|
if django.VERSION[0] >= 1 and django.VERSION[1] >= 7:
|
||||||
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
application = get_wsgi_application()
|
||||||
|
|
||||||
|
if django.VERSION[0] >= 1 and django.VERSION[1] <= 5:
|
||||||
management.call_command('test', 'app')
|
management.call_command('test', 'app')
|
||||||
else:
|
else:
|
||||||
management.call_command('test', 'example.app')
|
management.call_command('test', 'example.app')
|
||||||
|
|
27
tox.ini
27
tox.ini
|
@ -1,5 +1,5 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py27-dj16,py27-dj15,py27-dj14,py33-dj16,py33-dj15,py26-dj16,py26-dj15,py26-dj14
|
envlist = py27-dj17,py27-dj16,py27-dj15,py27-dj14,py34-dj17,py33-dj17,py33-dj16,py33-dj15,py26-dj16,py26-dj15,py26-dj14
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
@ -33,6 +33,14 @@ deps =
|
||||||
PyYAML==3.10
|
PyYAML==3.10
|
||||||
coveralls==0.3
|
coveralls==0.3
|
||||||
|
|
||||||
|
[testenv:py27-dj17]
|
||||||
|
basepython = python2.7
|
||||||
|
deps =
|
||||||
|
django==1.7
|
||||||
|
pillow==1.7.8
|
||||||
|
PyYAML==3.10
|
||||||
|
coveralls==0.3
|
||||||
|
|
||||||
[testenv:py27-dj16]
|
[testenv:py27-dj16]
|
||||||
basepython = python2.7
|
basepython = python2.7
|
||||||
deps =
|
deps =
|
||||||
|
@ -58,6 +66,23 @@ deps =
|
||||||
PyYAML==3.10
|
PyYAML==3.10
|
||||||
coveralls==0.3
|
coveralls==0.3
|
||||||
|
|
||||||
|
[testenv:py34-dj17]
|
||||||
|
basepython = python3.4
|
||||||
|
deps =
|
||||||
|
django==1.7
|
||||||
|
pillow==2.1.0
|
||||||
|
PyYAML==3.10
|
||||||
|
coveralls==0.3
|
||||||
|
|
||||||
|
[testenv:py33-dj17]
|
||||||
|
basepython = python3.3
|
||||||
|
deps =
|
||||||
|
django==1.7
|
||||||
|
pillow==2.1.0
|
||||||
|
PyYAML==3.10
|
||||||
|
coveralls==0.3
|
||||||
|
|
||||||
|
|
||||||
[testenv:py33-dj16]
|
[testenv:py33-dj16]
|
||||||
basepython = python3.3
|
basepython = python3.3
|
||||||
deps =
|
deps =
|
||||||
|
|
Loading…
Reference in New Issue