Merge branch 'master' into develop
authorStephen Burrows <stephen.r.burrows@gmail.com>
Tue, 14 Jun 2011 23:24:09 +0000 (19:24 -0400)
committerStephen Burrows <stephen.r.burrows@gmail.com>
Tue, 14 Jun 2011 23:24:09 +0000 (19:24 -0400)
README
README.markdown
docs/index.rst
docs/tutorials/getting-started.rst
docs/tutorials/shipherd.rst
philo/__init__.py
philo/middleware.py

diff --git a/README b/README
index f1ef32e..dbd9cc2 100644 (file)
--- a/README
+++ b/README
@@ -5,10 +5,12 @@ Prerequisites:
        * Django 1.3+ <http://www.djangoproject.com/>
        * django-mptt e734079+ <https://github.com/django-mptt/django-mptt/> 
        * (Optional) django-grappelli 2.0+ <http://code.google.com/p/django-grappelli/>
-       * (Optional) recaptcha-django r6 <http://code.google.com/p/recaptcha-django/>
        * (Optional) south 0.7.2+ <http://south.aeracode.org/>
+       * (Optional) recaptcha-django r6 <http://code.google.com/p/recaptcha-django/>
+
+To contribute, please visit the project website <http://project.philocms.org/> and/or make a fork of the git repository on GitHub <http://github.com/ithinksw/philo> or Gitorious <http://gitorious
+.org/ithinksw/philo>. Feel free to join us on IRC at irc://irc.oftc.net/#philo.
 
-To contribute, please visit the project website <http://philocms.org/>. Feel free to join us on IRC at irc://irc.oftc.net/#philo.
 
 ====
 Using philo
index b85cb50..91a8115 100644 (file)
@@ -9,7 +9,8 @@ Prerequisites:
  * (Optional) [south 0.7.2+ &lt;http://south.aeracode.org/)](http://south.aeracode.org/)
  * (Optional) [recaptcha-django r6 &lt;http://code.google.com/p/recaptcha-django/&gt;](http://code.google.com/p/recaptcha-django/)
 
-To contribute, please visit the [project website](http://philocms.org/). Feel free to join us on IRC at [irc://irc.oftc.net/#philo](irc://irc.oftc.net/#philo>).
+To contribute, please visit the [project website](http://project.philocms.org/) and/or make a fork of the git repository on [GitHub](http://github.com/ithinksw/philo) or [Gitorious](http://gitorious
+.org/ithinksw/philo). Feel free to join us on IRC at [irc://irc.oftc.net/#philo](irc://irc.oftc.net/#philo).
 
 Using philo
 ===========
index 079185d..7e960a0 100644 (file)
@@ -19,7 +19,7 @@ Prerequisites:
 * (Optional) `south 0.7.2+ <http://south.aeracode.org/>`_
 * (Optional) `recaptcha-django r6 <http://code.google.com/p/recaptcha-django/>`_
 
-To contribute, please visit the `project website <http://philocms.org/>`_ or make a fork of the git repository on `GitHub <http://github.com/ithinksw/philo>`_ or `Gitorious <http://gitorious.org/ithinksw/philo>`_. Feel free to join us on IRC at `irc://irc.oftc.net/#philo <irc://irc.oftc.net/#philo>`_.
+To contribute, please visit the `project website <http://project.philocms.org/>`_ and/or make a fork of the git repository on `GitHub <http://github.com/ithinksw/philo>`_ or `Gitorious <http://gitorious.org/ithinksw/philo>`_. Feel free to join us on IRC at `irc://irc.oftc.net/#philo <irc://irc.oftc.net/#philo>`_.
 
 Contents
 ++++++++
index d5d4c71..11eb927 100644 (file)
@@ -53,7 +53,7 @@ Now that you've got everything configured, it's time to set up your first page!
 
 Next, add a philo :class:`.Page` - let's call it "Hello World Page" and use the template you just made.
 
-Now make a philo :class:`.Node`. Give it the slug ``hello-world``. Set the view content type to "Page" and use the page that you just made. If you navigate to ``/hello-world``, you will see the results of rendering the page!
+Now make a philo :class:`.Node`. Give it the slug ``hello-world``. Set the ``view_content_type`` to "Page" and the ``view_object_id`` to the id of the page that you just made - probably 1. If you navigate to ``/hello-world``, you will see the results of rendering the page!
 
 Setting the root node
 +++++++++++++++++++++
@@ -78,7 +78,7 @@ Great! We've got a page that says "Hello World". But what if we want it to say s
                {% if content %}
                    <p>{{ content }}</p>
                {% endif %}
-               <p>The time is {% now %}.</p>
+               <p>The time is {% now "jS F Y H:i" %}.</p>
            </body>
        </html>
 
index f7988e6..3a62cb0 100644 (file)
@@ -3,7 +3,7 @@ Using Shipherd in the Admin
 
 The navigation mechanism is fairly complex; unfortunately, there's no real way around that - without a lot of equally complex code that you are quite welcome to write and contribute! ;-)
 
-For this guide, we'll assume that you have the setup described in :doc:`getting-started`. We'll be adding a main :class:`.Navigation` to the root :class:`.Node` and making it display as part of the :class:`.Template`.
+For this guide, we'll assume that you have the setup described in :doc:`getting-started`. We'll be adding a main :class:`.Navigation` to the root :class:`.Node` and making it display as part of the :class:`.Template`. Before getting started, make sure that you've added :mod:`philo.contrib.shipherd` to your :setting:`INSTALLED_APPS`.
 
 Creating the Navigation
 +++++++++++++++++++++++
index e574b70..c07c373 100644 (file)
@@ -1 +1 @@
-VERSION = (0, '1rc')
+VERSION = (0, 9)
index 037fdc8..f4f7e9d 100644 (file)
@@ -36,7 +36,12 @@ def get_node(path):
 
 
 class RequestNodeMiddleware(object):
-       """Adds a ``node`` attribute, representing the currently-viewed node, to every incoming :class:`HttpRequest` object. This is required by :func:`philo.views.node_view`."""
+       """
+       Adds a ``node`` attribute, representing the currently-viewed :class:`.Node`, to every incoming :class:`HttpRequest` object. This is required by :func:`philo.views.node_view`.
+       
+       :class:`RequestNodeMiddleware` also catches all exceptions raised while handling requests that have attached :class:`.Node`\ s if :setting:`settings.DEBUG` is ``True``. If a :exc:`django.http.Http404` error was caught, :class:`RequestNodeMiddleware` will look for an "Http404" :class:`.Attribute` on the request's :class:`.Node`; otherwise it will look for an "Http500" :class:`.Attribute`. If an appropriate :class:`.Attribute` is found, and the value of the attribute is a :class:`.View` instance, then the :class:`.View` will be rendered with the exception in the ``extra_context``, bypassing any later handling of exceptions.
+       
+       """
        def process_view(self, request, view_func, view_args, view_kwargs):
                try:
                        path = view_kwargs['path']
@@ -51,12 +56,16 @@ class RequestNodeMiddleware(object):
                
                if isinstance(exception, Http404):
                        error_view = request.node.attributes.get('Http404', None)
+                       status_code = 404
                else:
                        error_view = request.node.attributes.get('Http500', None)
+                       status_code = 500
                
                if error_view is None or not isinstance(error_view, View):
                        # Should this be duck-typing? Perhaps even no testing?
                        return
                
                extra_context = {'exception': exception}
-               return error_view.render_to_response(request, extra_context)
\ No newline at end of file
+               response = error_view.render_to_response(request, extra_context)
+               response.status_code = status_code
+               return response
\ No newline at end of file