PiRSquared17 / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

LOBs in Oracle (get_page_ids_by_slug fix) #109

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The current get_page_ids_by_slug method doesn't work with Oracle because
you aren't allowed to use a LOB in a where clause.

I worked around this by using to_char (in manager.py):
AND to_char(pages_content.body) =%s

Provided the slug is less than 4000 characters this should work. I'm not
sure if this tweak would have to be Oracle specific or would be ok for all
db backends.

Original issue reported on code.google.com by nother...@gmail.com on 26 May 2009 at 6:41

GoogleCodeExporter commented 9 years ago
4000 seems already to much for a slug, But for other content, we should 
certainly be
able to have more

Original comment by batiste....@gmail.com on 27 May 2009 at 6:03

GoogleCodeExporter commented 9 years ago
If that method is only used to look up slugs then it should be ok since, as you 
say,
slugs would never be that long. The to_char is just in this one place and will 
take
the first 4000 characters of the body (the bit of the lob that is stored inline 
like
a varchar, irrc).

Original comment by nother...@gmail.com on 27 May 2009 at 2:51

GoogleCodeExporter commented 9 years ago
The problem is that now the table where content (title, slugs, every other 
contents)
are is the same for everyone of them, so it could be bigger. But you fix seems 
nice
and welcome. Do you think you can implement it in a way that work with MySQL, 
SQLite
and Postgres?

If you do I will integrate the patch into the codebase.

Original comment by batiste....@gmail.com on 29 May 2009 at 7:58