summaryrefslogtreecommitdiff
path: root/docs/tutorials/lxmlgraph/step02
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2008-07-24 20:54:31 +0000
committerChris McDonough <chrism@agendaless.com>2008-07-24 20:54:31 +0000
commit14c8095fd1f088dbfd27a450c9da6b0e0b4d9a6b (patch)
treef13ea41afada16606877568b3fc3bd4fac5e2176 /docs/tutorials/lxmlgraph/step02
parente8a2f4a540f6a8ec0947c19f319d2e5235e8cdf8 (diff)
downloadpyramid-14c8095fd1f088dbfd27a450c9da6b0e0b4d9a6b.tar.gz
pyramid-14c8095fd1f088dbfd27a450c9da6b0e0b4d9a6b.tar.bz2
pyramid-14c8095fd1f088dbfd27a450c9da6b0e0b4d9a6b.zip
Steps 1 & 2 appear sane.
Diffstat (limited to 'docs/tutorials/lxmlgraph/step02')
-rw-r--r--docs/tutorials/lxmlgraph/step02/myapp/configure.zcml2
-rw-r--r--docs/tutorials/lxmlgraph/step02/myapp/models.py9
-rw-r--r--docs/tutorials/lxmlgraph/step02/myapp/views.py2
3 files changed, 7 insertions, 6 deletions
diff --git a/docs/tutorials/lxmlgraph/step02/myapp/configure.zcml b/docs/tutorials/lxmlgraph/step02/myapp/configure.zcml
index 540526ec9..d299dc883 100644
--- a/docs/tutorials/lxmlgraph/step02/myapp/configure.zcml
+++ b/docs/tutorials/lxmlgraph/step02/myapp/configure.zcml
@@ -5,7 +5,7 @@
<bfg:view
for=".models.IMyModel"
- view=".views.my_hello_view"
+ view=".views.my_view"
/>
</configure>
diff --git a/docs/tutorials/lxmlgraph/step02/myapp/models.py b/docs/tutorials/lxmlgraph/step02/myapp/models.py
index 3c03de1a9..1d93ccdd0 100644
--- a/docs/tutorials/lxmlgraph/step02/myapp/models.py
+++ b/docs/tutorials/lxmlgraph/step02/myapp/models.py
@@ -1,3 +1,5 @@
+import os
+
from zope.interface import implements
from zope.interface import Attribute
from zope.interface import Interface
@@ -32,10 +34,9 @@ def get_root(environ):
parser.set_element_class_lookup(parser_lookup)
# Now load the XML file
- xmlstring = open("myapp/samplemodel.xml").read()
+ here = os.path.join(os.path.dirname(__file__))
+ samplemodel = os.path.join(here, 'samplemodel.xml')
+ xmlstring = open(samplemodel).read()
root = etree.XML(xmlstring, parser)
return root
-
-
-
diff --git a/docs/tutorials/lxmlgraph/step02/myapp/views.py b/docs/tutorials/lxmlgraph/step02/myapp/views.py
index 205b4b163..75e390efb 100644
--- a/docs/tutorials/lxmlgraph/step02/myapp/views.py
+++ b/docs/tutorials/lxmlgraph/step02/myapp/views.py
@@ -1,6 +1,6 @@
from webob import Response
-def my_hello_view(context, request):
+def my_view(context, request):
response = Response('Hello to %s from %s @ %s' % (
context.tag,
context.__name__,