Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions explorer/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from explorer.utils import passes_blacklist, swap_params, extract_params, shared_dict_update, get_connection, get_s3_connection
from future.utils import python_2_unicode_compatible
from django.db import models, DatabaseError
from time import time
from django.core.urlresolvers import reverse
Expand All @@ -12,7 +13,7 @@

logger = logging.getLogger(__name__)


@python_2_unicode_compatible
class Query(models.Model):
title = models.CharField(max_length=255)
sql = models.TextField()
Expand All @@ -31,8 +32,8 @@ class Meta:
ordering = ['title']
verbose_name_plural = 'Queries'

def __unicode__(self):
return six.text_type(self.title)
def __str__(self):
return self.title

def get_run_count(self):
return self.querylog_set.count()
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ six==1.10.0
sqlparse==0.1.18
unicodecsv==0.14.1
ago==0.0.93
# py2/3 compatible libraries
future==0.18.2