diff options
| author | Paul Everitt <paul@agendaless.com> | 2008-07-25 15:24:07 +0000 |
|---|---|---|
| committer | Paul Everitt <paul@agendaless.com> | 2008-07-25 15:24:07 +0000 |
| commit | 992ef769cbbcb7a47b53d299e551b70d80e993b9 (patch) | |
| tree | 26cc57f79b8dfeec6c7224d99320d0468677f74a /docs/tutorials/lxmlgraph/step04 | |
| parent | 3bb4cdcbd5c0a5ddb994d1f12f1f38066fc49cba (diff) | |
| download | pyramid-992ef769cbbcb7a47b53d299e551b70d80e993b9.tar.gz pyramid-992ef769cbbcb7a47b53d299e551b70d80e993b9.tar.bz2 pyramid-992ef769cbbcb7a47b53d299e551b70d80e993b9.zip | |
Step 4 written up. I also made the small changes to the models.py that Chris had in Step 03.
Diffstat (limited to 'docs/tutorials/lxmlgraph/step04')
| -rw-r--r-- | docs/tutorials/lxmlgraph/step04/myapp/models.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/tutorials/lxmlgraph/step04/myapp/models.py b/docs/tutorials/lxmlgraph/step04/myapp/models.py index 3c03de1a9..a0d64ef59 100644 --- a/docs/tutorials/lxmlgraph/step04/myapp/models.py +++ b/docs/tutorials/lxmlgraph/step04/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,7 +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 |
