fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move checking membership to Membership.
[wolnelektury.git]
/
src
/
lesmianator
/
models.py
diff --git
a/src/lesmianator/models.py
b/src/lesmianator/models.py
index
0595810
..
47b4315
100644
(file)
--- a/
src/lesmianator/models.py
+++ b/
src/lesmianator/models.py
@@
-1,7
+1,7
@@
-# -*- coding: utf-8 -*-
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
+from functools import reduce
import pickle
from pickle import PickleError
from datetime import datetime
import pickle
from pickle import PickleError
from datetime import datetime
@@
-31,7
+31,7
@@
class Poem(models.Model):
view_count = models.IntegerField(_('view count'), default=1)
try:
view_count = models.IntegerField(_('view count'), default=1)
try:
- f = open(settings.LESMIANATOR_PICKLE)
+ f = open(settings.LESMIANATOR_PICKLE
, 'rb'
)
global_dictionary = pickle.load(f)
f.close()
except (IOError, AttributeError, PickleError):
global_dictionary = pickle.load(f)
f.close()
except (IOError, AttributeError, PickleError):
@@
-155,7
+155,7
@@
class Continuations(models.Model):
obj = cls.objects.get(content_type=object_type, object_id=sth.id)
if not obj.pickle:
raise cls.DoesNotExist
obj = cls.objects.get(content_type=object_type, object_id=sth.id)
if not obj.pickle:
raise cls.DoesNotExist
- f = open(obj.pickle.path)
+ f = open(obj.pickle.path
, 'rb'
)
keys, conts = pickle.load(f)
f.close()
if set(keys) != should_keys:
keys, conts = pickle.load(f)
f.close()
if set(keys) != should_keys: