tags:

views:

334

answers:

4

I've got a django 1.1 application for which it would save a lot of work to use django-tagging.

I've added a TagField() to the model.

Provided I don't register the model I can save instances of the model. But when I register the model

tagging.register(mymodel)

Then save an instance it fails thus:

Traceback (most recent call last): 
   File "scripts/migrate-qna.py", line 42, in <module>
     qna.save()
   ...
   File "django/db/backends/util.py", line 19, in execute
   psycopg2.ProgrammingError: can't adapt`

Question is whether this is my problem or if django-tagging 0.3 is just incompatible with django 1.1?

+1  A: 

Nope. django-tagging 0.3 doesn't work on django 1.1. It's a known issue documented on google code

notnoop
The issue (#215) reports "Most things are working"... so it's not totally broken. I've got things working, just not the TagField(). Is it something to do with the 'contribute_to_class' signals and whatnot?
John Mee
hmm - am testing but the TagField() seems to work for me ... I haven't gotten to the template tags portion yet, but tags are being entered correctly.
thornomad
Have you got TagField working in the Admin? Tagging works so long as I don't register the model as described in my Q. Unfortunately this piece of the puzzle is what makes it possible to enter the tags in the admin interface. Without it it seems to be just a charfield.Further study suggests the problem lies in the 'TagDescriptor' manager class. It attaches itself to the model as an attribute; but it looks like the database abstraction can't cope with this faux attribute. I've seen django's update routine called with tags parameter as a sql query, rather than the result of the query.
John Mee
A: 

I'm having the exact same issue as you. At least using the tagging app without registering works...

Unfortunately django-tagging's development seems a little glacial, so a fix is probably a long time off...

nbv4
A: 

if, you're getting an error like "TemplateSyntaxError: Caught an exception while rendering: 'Query' object has no attribute 'get_from_clause'", there is a patch here:

http://code.google.com/p/django-tagging/issues/detail?id=233&amp;start=100

hopefully it will get to be added to the SVN repo soon..!

zack
+1  A: 

The bug that captured the problem was issue 233. It's now fixed in trunk as of r172.

Elliot Foster