Upgrate fnpdjango to 0.2.
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Thu, 19 Mar 2015 15:20:10 +0000 (16:20 +0100)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Thu, 19 Mar 2015 15:20:10 +0000 (16:20 +0100)
apps/catalogue/management/commands/assign_from_redmine.py
apps/catalogue/management/commands/merge_books.py
apps/catalogue/migrations/0003_from_hg.py
apps/catalogue/models/book.py
apps/catalogue/views.py
requirements.txt

index 03c0637..31bdc14 100644 (file)
@@ -12,7 +12,7 @@ from django.core.management.base import BaseCommand
 from django.core.management.color import color_style
 from django.db import transaction
 
-from fnpdjango.utils.text.slughifi import slughifi
+from slugify import slugify
 from catalogue.models import Chunk
 
 
@@ -91,7 +91,7 @@ class Command(BaseCommand):
                 if fname.endswith('.xml'):
                     fname = fname[:-4]
                 fname = fname.replace(' ', '_')
-                fname = slughifi(fname)
+                fname = slugify(fname)
 
                 chunks = Chunk.objects.filter(book__slug=fname)
                 if not chunks:
index 62f8381..5499d3d 100644 (file)
@@ -8,7 +8,6 @@ from django.core.management.base import BaseCommand
 from django.core.management.color import color_style
 from django.db import transaction
 
-from fnpdjango.utils.text.slughifi import slughifi
 from catalogue.models import Book
 
 
index c0b4dad..e542d50 100644 (file)
@@ -11,7 +11,7 @@ from south.db import db
 from south.v2 import DataMigration
 
 from django.conf import settings
-from fnpdjango.utils.text.slughifi import slughifi
+from slugify import slugify
 
 META_REGEX = re.compile(r'\s*<!--\s(.*?)-->', re.DOTALL | re.MULTILINE)
 STAGE_TAGS_RE = re.compile(r'^#stage-finished: (.*)$', re.MULTILINE)
@@ -54,7 +54,7 @@ def gallery(slug, text):
             except ValueError:
                 continue
 
-    gallery = result.get('gallery', slughifi(slug))
+    gallery = result.get('gallery', slugify(slug))
 
     if gallery.startswith('/'):
         gallery = os.path.basename(gallery)
@@ -68,7 +68,7 @@ def migrate_file_from_hg(orm, fname, entry):
     if fname.endswith('.xml'):
         fname = fname[:-4]
     title = file_to_title(fname)
-    fname = slughifi(fname)
+    fname = slugify(fname)
 
     # create all the needed objects
     # what if it already exists?
index a30931d..e320af7 100755 (executable)
@@ -8,7 +8,7 @@ from django.db import models, transaction
 from django.template.loader import render_to_string
 from django.utils.translation import ugettext_lazy as _
 from django.conf import settings
-from fnpdjango.utils.text.slughifi import slughifi
+from slugify import slugify
 
 
 import apiclient
@@ -127,7 +127,7 @@ class Book(models.Model):
             if not title:
                 title = u'część %d' % (i + 1)
 
-            slug = slughifi(title)
+            slug = slugify(title)
 
             if i < book_len:
                 chunk = instance[i]
@@ -167,7 +167,7 @@ class Book(models.Model):
         if titles is not None:
             assert len(titles) == len_other
             if slugs is None:
-                slugs = [slughifi(t) for t in titles]
+                slugs = [slugify(t) for t in titles]
 
         for i, chunk in enumerate(other):
             # move chunk to new book
@@ -220,7 +220,7 @@ class Book(models.Model):
 
         for i in range(len(self), len(other)):
             title = u"pusta część %d" % i
-            chunk = self.add(slughifi(title), title)
+            chunk = self.add(slugify(title), title)
             chunk.commit('')
 
         for i in range(len(other)):
index 5aeab7a..8a96dc6 100644 (file)
@@ -144,7 +144,7 @@ def upload(request):
     if request.method == "POST":
         form = forms.DocumentsUploadForm(request.POST, request.FILES)
         if form.is_valid():
-            from fnpdjango.utils.text.slughifi import slughifi
+            from slugify import slugify
 
             if request.user.is_authenticated():
                 creator = request.user
@@ -161,7 +161,7 @@ def upload(request):
                 if filename[-1] == '/':
                     continue
                 title = os.path.basename(filename)[:-4]
-                slug = slughifi(title)
+                slug = slugify(title)
                 if not (slug and filename.endswith('.xml')):
                     skipped_list.append(filename)
                 elif slug in slugs:
index 1bc4f09..3c82e4d 100644 (file)
@@ -1,4 +1,4 @@
--i http://py.mdrn.pl:8443/simple
+-i https://py.mdrn.pl:8443/simple
 
 ## Python libraries
 lxml>=2.2.2
@@ -13,13 +13,14 @@ httplib2 # oauth2 dependency
 
 ## Django
 Django>=1.6,<1.7
-fnpdjango<0.2
+fnpdjango>=0.2,<0.3
 django-pipeline>=1.2,<1.3
 django_cas>=2.1,<2.2
 sorl-thumbnail>=11.09,<12
 django-maintenancemode>=0.9
 django-pagination
 django-gravatar2
+python-slugify
 
 celery>=3.1.12,<3.2
 kombu>=3.0,<3.1