Revision: 652
Author: batiste.bieler
Date: Fri Aug 21 10:44:30 2009
Log: Fix bug 152
http://code.google.com/p/django-page-cms/source/detail?r=652

Modified:
  /trunk/pages/managers.py
  /trunk/pages/models.py
  /trunk/pages/settings.py
  /trunk/pages/templatetags/pages_tags.py
  /trunk/pages/tests/pages_tests.py

=======================================
--- /trunk/pages/managers.py    Thu Aug 20 09:47:19 2009
+++ /trunk/pages/managers.py    Fri Aug 21 10:44:30 2009
@@ -143,11 +143,11 @@
      def get_content(self, page, language, ctype, language_fallback=False):
          """Gets the latest ``Content`` for a particular page and language.
          Falls back to another language if wanted."""
-        PAGE_CONTENT_DICT_KEY = "page_content_dict_%d_%s"
+        PAGE_CONTENT_DICT_KEY = "page_content_dict_%s_%s"
          if not language:
              language = settings.PAGE_DEFAULT_LANGUAGE

-        content_dict = cache.get(PAGE_CONTENT_DICT_KEY % (page.id, ctype))
+        content_dict = cache.get(PAGE_CONTENT_DICT_KEY % (str(page.id),  
ctype))
          #content_dict = None

          if not content_dict:
=======================================
--- /trunk/pages/models.py      Mon Aug  3 07:27:37 2009
+++ /trunk/pages/models.py      Fri Aug 21 10:44:30 2009
@@ -286,10 +286,10 @@
          return self.level * 2

      def __unicode__(self):
-        slug = self.slug()
-        # when created in console mode, page has no slug
-        if slug is None:
-            return "Page %d" % self.id
+        if self.id:
+            slug = self.slug()
+        else:
+            return "Page %s" % self.id
          return slug

  # Don't register the Page model twice.
=======================================
--- /trunk/pages/settings.py    Mon Aug 17 00:45:44 2009
+++ /trunk/pages/settings.py    Fri Aug 21 10:44:30 2009
@@ -120,7 +120,7 @@
  PAGES_MEDIA_URL = getattr(settings, 'PAGES_MEDIA_URL',  
join(settings.MEDIA_URL,
                                                              'pages/'))

-# Hide the slug's of the first root page ie: ``/home/ becomes ``/``
+# Hide the slug's of the first root page ie: ``/home/`` becomes ``/``
  PAGE_HIDE_ROOT_SLUG = getattr(settings, 'PAGE_HIDE_ROOT_SLUG', False)

  # Show the publication start date field in the admin.  Allows for future  
dating
=======================================
--- /trunk/pages/templatetags/pages_tags.py     Thu Aug 20 09:26:45 2009
+++ /trunk/pages/templatetags/pages_tags.py     Fri Aug 21 10:44:30 2009
@@ -215,6 +215,7 @@
              page_dict = details(request, only_context=True)
              context.update(page_dict)
          except Exception, e:
+            context.update({'current_page': Page()})
              pass
          return ''

=======================================
--- /trunk/pages/tests/pages_tests.py   Mon Aug  3 07:26:03 2009
+++ /trunk/pages/tests/pages_tests.py   Fri Aug 21 10:44:30 2009
@@ -672,4 +672,12 @@
          # calling via its alias must cause redirect
          response = c.get('/pages/index.php?page=downloads')
          self.assertRedirects(response, '/pages/downloads-page/', 301)
-
+
+    def test_27_bug_152(self):
+        # http://code.google.com/p/django-page-cms/issues/detail?id=152
+        from pages.utils import get_placeholders
+        self.assertEqual(
+            str(get_placeholders('tests/test1.html')),
+            "[<Placeholder Node: body>]"
+        )
+

--~--~---------~--~----~------------~-------~--~----~
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