From: Radek Czajka Date: Thu, 19 Jan 2012 14:25:14 +0000 (+0100) Subject: move some imports X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/a91eb26eb1627fbb4ca7bd15ff850e0393ca817e?ds=sidebyside;hp=--cc move some imports --- a91eb26eb1627fbb4ca7bd15ff850e0393ca817e diff --git a/apps/dictionary/models.py b/apps/dictionary/models.py index b22e4be42..1d2fbba39 100644 --- a/apps/dictionary/models.py +++ b/apps/dictionary/models.py @@ -4,7 +4,6 @@ # from django.db import models -from librarian import html from sortify import sortify from catalogue.models import Book @@ -21,6 +20,8 @@ class Note(models.Model): def notes_from_book(sender, **kwargs): + from librarian import html + Note.objects.filter(book=sender).delete() if sender.html_file: for anchor, text_str, html_str in html.extract_annotations(sender.html_file.path): diff --git a/apps/lesmianator/models.py b/apps/lesmianator/models.py index 5103ebbf1..1d057c2da 100644 --- a/apps/lesmianator/models.py +++ b/apps/lesmianator/models.py @@ -18,7 +18,6 @@ from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.conf import settings -from librarian import text from catalogue.fields import JSONField from catalogue.models import Book, Tag @@ -124,6 +123,8 @@ class Continuations(models.Model): @classmethod def for_book(cls, book, length=3): + from librarian import text + # count from this book only output = StringIO() f = open(book.xml_file.path)