summaryrefslogtreecommitdiff
path: root/docs/tutorials/lxmlgraph/step03/myapp/models.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2008-07-25 00:39:59 +0000
committerChris McDonough <chrism@agendaless.com>2008-07-25 00:39:59 +0000
commitf7c48fe00eb624432f11142897e18dd78df9f642 (patch)
treeacdff927434f7a4dcd41dc509e17192e0ed8bb02 /docs/tutorials/lxmlgraph/step03/myapp/models.py
parent3c40c67500a765909d07c80339a76ede245a1d09 (diff)
downloadpyramid-f7c48fe00eb624432f11142897e18dd78df9f642.tar.gz
pyramid-f7c48fe00eb624432f11142897e18dd78df9f642.tar.bz2
pyramid-f7c48fe00eb624432f11142897e18dd78df9f642.zip
Work on Step 3.
Diffstat (limited to 'docs/tutorials/lxmlgraph/step03/myapp/models.py')
-rw-r--r--docs/tutorials/lxmlgraph/step03/myapp/models.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/tutorials/lxmlgraph/step03/myapp/models.py b/docs/tutorials/lxmlgraph/step03/myapp/models.py
index 3c03de1a9..1d93ccdd0 100644
--- a/docs/tutorials/lxmlgraph/step03/myapp/models.py
+++ b/docs/tutorials/lxmlgraph/step03/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
-
-
-