diff --git a/example/pexp/management/commands/p2cmd.py b/example/pexp/management/commands/p2cmd.py index 1c094e1..5b55f22 100644 --- a/example/pexp/management/commands/p2cmd.py +++ b/example/pexp/management/commands/p2cmd.py @@ -4,9 +4,10 @@ This module is a scratchpad for general development, testing & debugging Well, even more so than pcmd.py. You best ignore p2cmd.py. """ import uuid +import django from django.core.management.base import NoArgsCommand -from django.db.models import connection +from django.db import connection from pprint import pprint import time, sys @@ -14,7 +15,10 @@ from pexp.models import * def reset_queries(): - connection.queries = [] + if django.VERSION < (1, 9): + connection.queries = [] + else: + connection.queries_log.clear() def show_queries(): diff --git a/example/pexp/management/commands/pcmd.py b/example/pexp/management/commands/pcmd.py index 48dadb3..b496ba7 100644 --- a/example/pexp/management/commands/pcmd.py +++ b/example/pexp/management/commands/pcmd.py @@ -4,7 +4,7 @@ This module is a scratchpad for general development, testing & debugging. """ from django.core.management.base import NoArgsCommand -from django.db.models import connection +from django.db import connection from pprint import pprint from pexp.models import * diff --git a/example/pexp/management/commands/polybench.py b/example/pexp/management/commands/polybench.py index 4656045..f056b26 100644 --- a/example/pexp/management/commands/polybench.py +++ b/example/pexp/management/commands/polybench.py @@ -3,8 +3,9 @@ This module is a scratchpad for general development, testing & debugging """ +import django from django.core.management.base import NoArgsCommand -from django.db.models import connection +from django.db import connection from pprint import pprint import sys from pexp.models import * @@ -13,7 +14,10 @@ num_objects = 1000 def reset_queries(): - connection.queries = [] + if django.VERSION < (1, 9): + connection.queries = [] + else: + connection.queries_log.clear() def show_queries(): diff --git a/example/pexp/management/commands/polymorphic_create_test_data.py b/example/pexp/management/commands/polymorphic_create_test_data.py index 7f0ff44..bade771 100644 --- a/example/pexp/management/commands/polymorphic_create_test_data.py +++ b/example/pexp/management/commands/polymorphic_create_test_data.py @@ -4,7 +4,7 @@ This module is a scratchpad for general development, testing & debugging """ from django.core.management.base import NoArgsCommand -from django.db.models import connection +from django.db import connection from pprint import pprint from pexp.models import *