(self, key)
| 731 | encoding = "marcxml" |
| 732 | |
| 733 | def GET(self, key): |
| 734 | page = web.ctx.site.get(key) |
| 735 | if page is None or page.type.key != "/type/edition": |
| 736 | raise web.notfound("") |
| 737 | else: |
| 738 | from infogami.utils import template |
| 739 | |
| 740 | try: |
| 741 | result = template.typetemplate("marcxml")(page) |
| 742 | except: |
| 743 | raise web.notfound("") |
| 744 | else: |
| 745 | return delegate.RawText(result, content_type="application/marcxml+xml; charset=utf-8") |
| 746 | |
| 747 | |
| 748 | delegate.media_types["text/x-yaml"] = "yml" |