X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d6f190d50127a1aca615ff505a8a2595b4cfb7de..24f677a3979ba3f1bdfe420c03ad5e3f8b0398c2:/src/isbn/forms.py diff --git a/src/isbn/forms.py b/src/isbn/forms.py index 147be0b52..2acc34a8e 100644 --- a/src/isbn/forms.py +++ b/src/isbn/forms.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- +from datetime import date from urllib2 import urlopen 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 @@ -13,7 +14,7 @@ from librarian.parser import WLDocument class WLISBNForm(forms.Form): platform_url = forms.URLField(label=u'Adres na platformie') - publishing_date = forms.DateField(label=u'Data publikacji') + publishing_date = forms.DateField(label=u'Data publikacji', initial=date.today) def prepare_data(self): platform_url = self.cleaned_data['platform_url'] @@ -85,7 +86,7 @@ class FNPISBNForm(forms.Form): return {'role': 'A01', 'name': output_name} def slug(self): - return slughifi('fnp %s %s' % (self.cleaned_data['authors'], self.cleaned_data['title'])) + return slugify('fnp %s %s' % (self.cleaned_data['authors'], self.cleaned_data['title'])) def save(self): data = {