summaryrefslogtreecommitdiff
path: root/docs/quick_tutorial/rest_ajax_layout.rst
diff options
context:
space:
mode:
authorPaul Everitt <paul@agendaless.com>2013-09-13 16:52:14 -0400
committerPaul Everitt <paul@agendaless.com>2013-09-13 16:52:14 -0400
commitb1b92284f496800a4dfd2cea72cb9be07ba8661c (patch)
tree9dfa72427fd6aa0a3a7aaba72be4a4e49380ee26 /docs/quick_tutorial/rest_ajax_layout.rst
parent1d04f8f0b483b8d595f5ada24ae5108affe80160 (diff)
downloadpyramid-b1b92284f496800a4dfd2cea72cb9be07ba8661c.tar.gz
pyramid-b1b92284f496800a4dfd2cea72cb9be07ba8661c.tar.bz2
pyramid-b1b92284f496800a4dfd2cea72cb9be07ba8661c.zip
First cut at import of quick tutorial.
Diffstat (limited to 'docs/quick_tutorial/rest_ajax_layout.rst')
-rw-r--r--docs/quick_tutorial/rest_ajax_layout.rst50
1 files changed, 50 insertions, 0 deletions
diff --git a/docs/quick_tutorial/rest_ajax_layout.rst b/docs/quick_tutorial/rest_ajax_layout.rst
new file mode 100644
index 000000000..921921b15
--- /dev/null
+++ b/docs/quick_tutorial/rest_ajax_layout.rst
@@ -0,0 +1,50 @@
+=========================
+28: REST with Ajax Layout
+=========================
+
+Produce a grid-like UI to prepare for async REST operations.
+
+Steps
+=====
+
+#. We are going to use the previous step as our starting point:
+
+ .. code-block:: bash
+
+ (env27)$ cd ..; cp -r rest_bootstrap rest_ajax_layout; cd rest_ajax_layout
+ (env27)$ python setup.py develop
+
+#. Get a new menu item for ``Folders`` in
+ ``rest_ajax_layout/tutorial/templates/layout.jinja2``:
+
+ .. literalinclude:: rest_ajax_layout/tutorial/templates/layout.jinja2
+ :language: html
+ :linenos:
+
+#. In ``rest_ajax_layout/tutorial/views.py``, add a JSON view and remove
+ unused previous views:
+
+ .. literalinclude:: rest_ajax_layout/tutorial/views.py
+ :linenos:
+
+#. Create a template at
+ ``rest_ajax_layout/tutorial/templates/folder.jinja2``:
+
+ .. literalinclude:: rest_ajax_layout/tutorial/templates/folder.jinja2
+ :language: html
+ :linenos:
+
+#. Do some cleanup:
+
+ .. code-block:: bash
+
+ (env27)$ rm tutorial/templates/*.pt
+
+#. Run your Pyramid application with:
+
+ .. code-block:: bash
+
+ (env27)$ pserve development.ini --reload
+
+#. Open ``http://localhost:6543/`` in your browser.
+