1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from librarian import DocProvider
8 class ORMDocProvider(DocProvider):
9 """Used for getting books' children."""
11 def __init__(self, book):
14 def by_slug(self, slug):
15 if slug == self.book.slug:
16 return open(self.book.xml_file.path)
18 return type(self.book).objects.get(slug=slug).xml_file