diff options
author | kinitrupti | 2016-10-24 12:32:11 +0530 |
---|---|---|
committer | kinitrupti | 2016-10-24 12:32:11 +0530 |
commit | eb3321f80def84e84329f213e21ef5ac94d4ccd6 (patch) | |
tree | 4c26ad501f9387e3d16c389603ae1432bd2c64fd /commentingapp/models.py | |
parent | 6da84d8c334e16ebea6597d8b83d51552935ed00 (diff) | |
download | Python-TBC-Interface-eb3321f80def84e84329f213e21ef5ac94d4ccd6.tar.gz Python-TBC-Interface-eb3321f80def84e84329f213e21ef5ac94d4ccd6.tar.bz2 Python-TBC-Interface-eb3321f80def84e84329f213e21ef5ac94d4ccd6.zip |
upgraded to python3
Diffstat (limited to 'commentingapp/models.py')
-rw-r--r-- | commentingapp/models.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/commentingapp/models.py b/commentingapp/models.py index 79e120e..66ae0a1 100644 --- a/commentingapp/models.py +++ b/commentingapp/models.py @@ -1,4 +1,3 @@ -from __future__ import unicode_literals from django.db import models from tbc.models import Chapters, Book from django.contrib.auth.models import User @@ -14,9 +13,9 @@ class Url (models.Model): url = models.URLField() def get_contributor_details(self, counter): - notebooks = [os.path.join(chapter_name.split("/")[-2], chapter_name.split('/')[-1]) for chapter_name in counter.keys()] + notebooks = [os.path.join(chapter_name.split("/")[-2], chapter_name.split('/')[-1]) for chapter_name in list(counter.keys())] contributor_list = [] - for notebook,url,number_of_comments in zip(notebooks, counter.keys(), counter.values()): + for notebook,url,number_of_comments in zip(notebooks, list(counter.keys()), list(counter.values())): contributor_dict = {} contributor_id = Book.objects.filter(Q(chapters__notebook = notebook)).values_list("contributor_id", flat = True) contributor = User.objects.filter(id = contributor_id[0]).values("email", "first_name", "last_name") |