ojengwa / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
1 stars 0 forks source link

TaggedItem.objects.get_related uses connection.ops.limit_offset_sql which is gone in Django 1.0 #164

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have the following code in my project model:

  if self.tags != None:
    TaggedItem.objects.get_related(self, Page, num=10)

This causes an AttributeError: 'DatabaseOperations' object has no attribute
'limit_offset_sql' 
 - tracked down to /Library/Python/2.5/site-packages/tagging/models.py in
get_related, line 422
 - line 422: 'limit_offset': num is not None and
connection.ops.limit_offset_sql(num) or '', 

Looking at Django 1.0 history, it seems this method was removed this
summer, see ticket #7532 <http://code.djangoproject.com/ticket/7532>

The ticket suggests another kind of approach, but I don't really understand
enough about it to suggest a fix yet. 

Original issue reported on code.google.com by lisa.dus...@gmail.com on 24 Sep 2008 at 5:43

GoogleCodeExporter commented 9 years ago
I've put in a temporary fix just to get tests working again (for databases 
which use
LIMIT syntax, at least)

Original comment by jonathan.buchanan on 30 Oct 2008 at 2:23