Skip to content

Commit

Permalink
Fix running example management commands in Django 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
vdboor committed Dec 28, 2015
1 parent b7431b2 commit 4e5ac03
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
8 changes: 6 additions & 2 deletions example/pexp/management/commands/p2cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
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

from pexp.models import *


def reset_queries():
connection.queries = []
if django.VERSION < (1, 9):
connection.queries = []
else:
connection.queries_log.clear()


def show_queries():
Expand Down
2 changes: 1 addition & 1 deletion example/pexp/management/commands/pcmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

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 *
Expand Down
8 changes: 6 additions & 2 deletions example/pexp/management/commands/polybench.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand All @@ -13,7 +14,10 @@


def reset_queries():
connection.queries = []
if django.VERSION < (1, 9):
connection.queries = []
else:
connection.queries_log.clear()


def show_queries():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

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 *
Expand Down

0 comments on commit 4e5ac03

Please sign in to comment.