fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d7514c4
)
upgrade fnpdjango
author
Jan Szejko
<janek37@gmail.com>
Tue, 10 Jul 2018 12:54:06 +0000
(14:54 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Tue, 10 Jul 2018 12:54:06 +0000
(14:54 +0200)
requirements/requirements.txt
patch
|
blob
|
history
src/catalogue/fields.py
patch
|
blob
|
history
src/catalogue/models/bookmedia.py
patch
|
blob
|
history
src/catalogue/models/tag.py
patch
|
blob
|
history
src/catalogue/test_utils.py
patch
|
blob
|
history
src/funding/utils.py
patch
|
blob
|
history
src/isbn/forms.py
patch
|
blob
|
history
src/picture/models.py
patch
|
blob
|
history
src/sortify.py
patch
|
blob
|
history
diff --git
a/requirements/requirements.txt
b/requirements/requirements.txt
index
631f473
..
20c7c97
100644
(file)
--- a/
requirements/requirements.txt
+++ b/
requirements/requirements.txt
@@
-2,7
+2,7
@@
# django
Django>=1.8,<1.9
# django
Django>=1.8,<1.9
-fnpdjango>=0.
1.15,<0.2
+fnpdjango>=0.
2.8,<0.3
django-pipeline>=1.6,<1.7
jsmin
fnp-django-pagination
django-pipeline>=1.6,<1.7
jsmin
fnp-django-pagination
diff --git
a/src/catalogue/fields.py
b/src/catalogue/fields.py
index
92e8de4
..
378377c
100644
(file)
--- a/
src/catalogue/fields.py
+++ b/
src/catalogue/fields.py
@@
-163,7
+163,7
@@
class BuildMobi(BuildEbook):
class BuildHtml(BuildEbook):
def build(self, fieldfile):
from django.core.files.base import ContentFile
class BuildHtml(BuildEbook):
def build(self, fieldfile):
from django.core.files.base import ContentFile
- from
fnpdjango.utils.text.slughifi import slughifi
+ from
slugify import slugify
from sortify import sortify
from librarian import html
from catalogue.models import Fragment, Tag
from sortify import sortify
from librarian import html
from catalogue.models import Fragment, Tag
@@
-204,7
+204,7
@@
class BuildHtml(BuildEbook):
if lang == settings.LANGUAGE_CODE:
# Allow creating themes if book in default language.
tag, created = Tag.objects.get_or_create(
if lang == settings.LANGUAGE_CODE:
# Allow creating themes if book in default language.
tag, created = Tag.objects.get_or_create(
- slug=slug
hifi
(theme_name),
+ slug=slug
ify
(theme_name),
category='theme')
if created:
tag.name = theme_name
category='theme')
if created:
tag.name = theme_name
diff --git
a/src/catalogue/models/bookmedia.py
b/src/catalogue/models/bookmedia.py
index
6b65080
..
377dbc4
100644
(file)
--- a/
src/catalogue/models/bookmedia.py
+++ b/
src/catalogue/models/bookmedia.py
@@
-8,14
+8,14
@@
from collections import namedtuple
from django.db import models
from django.utils.translation import ugettext_lazy as _
import jsonfield
from django.db import models
from django.utils.translation import ugettext_lazy as _
import jsonfield
-from
fnpdjango.utils.text.slughifi import slughifi
+from
slugify import slugify
from mutagen import MutagenError
from catalogue.fields import OverwriteStorage
def _file_upload_to(i, _n):
from mutagen import MutagenError
from catalogue.fields import OverwriteStorage
def _file_upload_to(i, _n):
- return 'book/%(ext)s/%(name)s.%(ext)s' % {'ext': i.ext(), 'name': slug
hifi
(i.name)}
+ return 'book/%(ext)s/%(name)s.%(ext)s' % {'ext': i.ext(), 'name': slug
ify
(i.name)}
class BookMedia(models.Model):
class BookMedia(models.Model):
@@
-66,7
+66,7
@@
class BookMedia(models.Model):
old = None
else:
# if name changed, change the file name, too
old = None
else:
# if name changed, change the file name, too
- if slug
hifi(self.name) != slughifi
(old.name):
+ if slug
ify(self.name) != slugify
(old.name):
self.file.save(None, ExistingFile(self.file.path), save=False)
super(BookMedia, self).save(*args, **kwargs)
self.file.save(None, ExistingFile(self.file.path), save=False)
super(BookMedia, self).save(*args, **kwargs)
diff --git
a/src/catalogue/models/tag.py
b/src/catalogue/models/tag.py
index
830f29f
..
7e15636
100644
(file)
--- a/
src/catalogue/models/tag.py
+++ b/
src/catalogue/models/tag.py
@@
-230,7
+230,7
@@
class Tag(TagBase):
@staticmethod
def tags_from_info(info):
@staticmethod
def tags_from_info(info):
- from
fnpdjango.utils.text.slughifi import slughifi
+ from
slugify import slugify
from sortify import sortify
meta_tags = []
categories = (('kinds', 'kind'), ('genres', 'genre'), ('authors', 'author'), ('epochs', 'epoch'))
from sortify import sortify
meta_tags = []
categories = (('kinds', 'kind'), ('genres', 'genre'), ('authors', 'author'), ('epochs', 'epoch'))
@@
-251,7
+251,7
@@
class Tag(TagBase):
tag_name = tag_name.readable()
if lang == settings.LANGUAGE_CODE:
# Allow creating new tag, if it's in default language.
tag_name = tag_name.readable()
if lang == settings.LANGUAGE_CODE:
# Allow creating new tag, if it's in default language.
- tag, created = Tag.objects.get_or_create(slug=slug
hifi
(tag_name), category=category)
+ tag, created = Tag.objects.get_or_create(slug=slug
ify
(tag_name), category=category)
if created:
tag_name = unicode(tag_name)
tag.name = tag_name
if created:
tag_name = unicode(tag_name)
tag.name = tag_name
diff --git
a/src/catalogue/test_utils.py
b/src/catalogue/test_utils.py
index
497b995
..
18c5674
100644
(file)
--- a/
src/catalogue/test_utils.py
+++ b/
src/catalogue/test_utils.py
@@
-7,7
+7,7
@@
import tempfile
from traceback import extract_stack
from django.test import TestCase
from django.test.utils import override_settings
from traceback import extract_stack
from django.test import TestCase
from django.test.utils import override_settings
-from
fnpdjango.utils.text.slughifi import slughifi
+from
slugify import slugify
from librarian import WLURI
from django.conf import settings
from librarian import WLURI
from django.conf import settings
@@
-72,7
+72,7
@@
class BookInfoStub(object):
def info_args(title, language=None):
""" generate some keywords for comfortable BookInfoCreation """
def info_args(title, language=None):
""" generate some keywords for comfortable BookInfoCreation """
- slug = unicode(slug
hifi
(title))
+ slug = unicode(slug
ify
(title))
if language is None:
language = u'pol'
return {
if language is None:
language = u'pol'
return {
diff --git
a/src/funding/utils.py
b/src/funding/utils.py
index
77d8981
..
5808336
100644
(file)
--- a/
src/funding/utils.py
+++ b/
src/funding/utils.py
@@
-4,7
+4,7
@@
#
import re
import string
#
import re
import string
-from fnpdjango.utils.text
.slughifi
import char_map
+from fnpdjango.utils.text import char_map
# PayU chokes on non-Polish diacritics.
# Punctuation is handled correctly and escaped as needed,
# PayU chokes on non-Polish diacritics.
# Punctuation is handled correctly and escaped as needed,
diff --git
a/src/isbn/forms.py
b/src/isbn/forms.py
index
558cd9a
..
2acc34a
100644
(file)
--- a/
src/isbn/forms.py
+++ b/
src/isbn/forms.py
@@
-4,7
+4,7
@@
from urllib2 import urlopen
from django import forms
from django.utils.translation import ugettext_lazy as _
from django import forms
from django.utils.translation import ugettext_lazy as _
-from
fnpdjango.utils.text.slughifi import slughifi
+from
slugify import slugify
from isbn.management.commands.import_onix import UNKNOWN
from isbn.models import ONIXRecord, ISBNPool
from isbn.management.commands.import_onix import UNKNOWN
from isbn.models import ONIXRecord, ISBNPool
@@
-86,7
+86,7
@@
class FNPISBNForm(forms.Form):
return {'role': 'A01', 'name': output_name}
def slug(self):
return {'role': 'A01', 'name': output_name}
def slug(self):
- return slug
hifi
('fnp %s %s' % (self.cleaned_data['authors'], self.cleaned_data['title']))
+ return slug
ify
('fnp %s %s' % (self.cleaned_data['authors'], self.cleaned_data['title']))
def save(self):
data = {
def save(self):
data = {
diff --git
a/src/picture/models.py
b/src/picture/models.py
index
455ed10
..
643149a
100644
(file)
--- a/
src/picture/models.py
+++ b/
src/picture/models.py
@@
-10,7
+10,7
@@
from django.conf import settings
from django.contrib.contenttypes.fields import GenericRelation
from django.core.files.storage import FileSystemStorage
from django.utils.datastructures import SortedDict
from django.contrib.contenttypes.fields import GenericRelation
from django.core.files.storage import FileSystemStorage
from django.utils.datastructures import SortedDict
-from
fnpdjango.utils.text.slughifi import slughifi
+from
slugify import slugify
from ssify import flush_ssi_includes
from catalogue.models.tag import prefetched_relations
from ssify import flush_ssi_includes
from catalogue.models.tag import prefetched_relations
@@
-224,7
+224,7
@@
class Picture(models.Model):
# str.capitalize() is wrong, because it also lowers letters
objname = objname[0].upper() + objname[1:]
tag, created = catalogue.models.Tag.objects.get_or_create(
# str.capitalize() is wrong, because it also lowers letters
objname = objname[0].upper() + objname[1:]
tag, created = catalogue.models.Tag.objects.get_or_create(
- slug=slug
hifi
(objname), category='thing')
+ slug=slug
ify
(objname), category='thing')
if created:
tag.name = objname
setattr(tag, 'name_%s' % lang, tag.name)
if created:
tag.name = objname
setattr(tag, 'name_%s' % lang, tag.name)
@@
-249,7
+249,7
@@
class Picture(models.Model):
for motifs in part['themes']:
for motif in motifs.split(','):
tag, created = catalogue.models.Tag.objects.get_or_create(
for motifs in part['themes']:
for motif in motifs.split(','):
tag, created = catalogue.models.Tag.objects.get_or_create(
- slug=slug
hifi
(motif), category='theme')
+ slug=slug
ify
(motif), category='theme')
if created:
tag.name = motif
tag.sort_key = sortify(tag.name)
if created:
tag.name = motif
tag.sort_key = sortify(tag.name)
diff --git
a/src/sortify.py
b/src/sortify.py
index
f1e8bcb
..
61cb9d8
100644
(file)
--- a/
src/sortify.py
+++ b/
src/sortify.py
@@
-1,6
+1,6
@@
# -*- coding: utf-8 -*-
import re
# -*- coding: utf-8 -*-
import re
-from fnpdjango.utils.text
.slughifi
import char_map
+from fnpdjango.utils.text import char_map
# Specifies diacritics order.
# Specifies diacritics order.