Package: python-django-djapian
Version: 2.3.1

I'm aiming to get Xapian 1.2 into the next Debian stable release, so I've 
been checking all the Debian packages which depend on Xapian.

Xapian 1.2.0 drops support for some deprecated features, and djapian seems 
to use a few of these:

http://trac.xapian.org/browser/trunk/xapian-core/docs/deprecation.rst#id5

I've attached a patch which corrects use of these deprecated features such
that the code should work both with Xapian 1.0.x and with 1.2.x, but it is
untested as I don't actually use djapian and don't know enough about it to
write a test.

There seem to be some tests in the djapian source, but I didn't see how to run
them.  If someone can explain how to, I'm happy to check.  If you want to
check with Xapian 1.2.x yourself, there are packages of xapian-core and
xapian-bindings in experimental (xapian-bindings only for x86-64 currently
as the experimental buildds don't take dependencies from experimental...)

I've filed this upstream already:

http://code.google.com/p/djapian/issues/detail?id=113

However, it has been tagged as "Milestone-Release2.5", so it seems unlikely
that there will be an upstream release with this fix in before the squeeze
freeze.

I'm happy to sponsor an upload.

Cheers,
    Olly
--- python-django-djapian-2.3.1.orig/src/djapian/resultset.py
+++ python-django-djapian-2.3.1/src/djapian/resultset.py
@@ -174,15 +174,15 @@
         self._resultset_cache = []
 
         for match in self._mset:
-            doc = match.get_document()
+            doc = match.document
 
             model = doc.get_value(2)
             model = get_model(*model.split('.'))
             pk = model._meta.pk.to_python(doc.get_value(1))
 
-            percent = match.get_percent()
-            rank = match.get_rank()
-            weight = match.get_weight()
+            percent = match.percent
+            rank = match.rank
+            weight = match.weight
 
             tags = dict([(tag.prefix, tag.extract(doc))\
                                 for tag in self._indexer.tags])

Attachment: signature.asc
Description: Digital signature

Reply via email to