diff -r d66abfc1cb87 -r 5e27a39d3742 src/ldt/ldt/text/models.py --- a/src/ldt/ldt/text/models.py Mon Jul 23 17:05:53 2012 +0200 +++ b/src/ldt/ldt/text/models.py Mon Jul 30 19:46:40 2012 +0200 @@ -1,9 +1,7 @@ -from annotindexer import AnnotIndexer from django.db import models from django.utils.translation import ugettext_lazy as _ from tagging.models import Tag from utils import generate_uuid -import ldt.indexation import lxml import tagging.fields #from django.core.management.validation import max_length @@ -117,26 +115,8 @@ def create_annotation(external_id, uri=None, tags=None, title=None, description=None, text=None, color=None, creator=None, contributor=None, creation_date=None, update_date=None): annotation = Annotation(external_id=external_id, uri=uri, tags=tags, title=title, description=description, text=text, color=color, creator=creator, contributor=contributor, creation_date=creation_date, update_date=update_date) annotation.save() - annotation.index_annot() return annotation - - def delete(self): - super(Annotation, self).delete() - ldt.indexation.delete_document("external_id", self.external_id) - - def index_annot(self): - writer = ldt.indexation.get_writer() - try: - annotl = [self, ] - indexer = AnnotIndexer(annotl, writer) - indexer.index_all() - finally: - writer.close() - - def update_index(self): - ldt.indexation.delete_document("external_id", self.external_id) - self.index_annot()