1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
4 from librarian import DocProvider
7 class ORMDocProvider(DocProvider):
8 """Used for getting books' children."""
10 def __init__(self, book):
13 def by_slug(self, slug):
14 if slug == self.book.slug:
15 return open(self.book.xml_file.path)
17 return type(self.book).objects.get(slug=slug).xml_file