Author: batiste.bieler
Date: Tue Mar  3 02:23:19 2009
New Revision: 385

Modified:
    trunk/pages/managers.py

Log:
Fix get_content SQL for postgresql

Modified: trunk/pages/managers.py
==============================================================================
--- trunk/pages/managers.py     (original)
+++ trunk/pages/managers.py     Tue Mar  3 02:23:19 2009
@@ -120,13 +120,13 @@
          to another language if wanted.
          """
          # used for the DISTINCT on the language. Should be nicer with a  
lot of revision
-        sql = '''SELECT DISTINCT(pages_content.language),  
pages_content.body
+        sql = '''SELECT DISTINCT(pages_content.language),  
pages_content.creation_date, pages_content.body
              FROM pages_content WHERE (pages_content.type = %s
              AND pages_content.page_id = %s )
              ORDER BY pages_content.creation_date ASC'''
          cursor = connection.cursor()
          cursor.execute(sql, (cnttype, page.id))
-        content_dict = dict([(c[0], c[1]) for c in cursor.fetchall()])
+        content_dict = dict([(c[0], c[2]) for c in cursor.fetchall()])
          if language in content_dict:
              return content_dict[language]
          # requested language not found. Try other languages one after

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to