Author: batiste.bieler
Date: Fri Feb 20 00:17:58 2009
New Revision: 357
Modified:
trunk/example/settings.py
trunk/pages/models.py
Log:
Fix issue 24
Modified: trunk/example/settings.py
==============================================================================
--- trunk/example/settings.py (original)
+++ trunk/example/settings.py Fri Feb 20 00:17:58 2009
@@ -112,7 +112,7 @@
('en', gettext_noop('English')),
)
-SQL_DEBUGGING = True
+SQL_DEBUGGING = False
DEFAULT_PAGE_TEMPLATE = 'pages/index.html'
Modified: trunk/pages/models.py
==============================================================================
--- trunk/pages/models.py (original)
+++ trunk/pages/models.py Fri Feb 20 00:17:58 2009
@@ -121,11 +121,13 @@
if languages:
return languages
- contents = Content.objects.filter(page=self, type="title")
languages = []
- for c in contents:
- if c.language not in languages:
- languages.append(c.language)
+ for lang in settings.PAGE_LANGUAGES:
+ try:
+ if Content.objects.filter(page=self, type="slug",
language=lang[0]).count() > 0:
+ languages.append(lang[0])
+ except Content.DoesNotExist:
+ pass
cache.set(self.PAGE_LANGUAGES_KEY % (self.id), languages)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---