-class ORMDocProvider(DocProvider):
- """Used for getting books' children."""
-
- def __init__(self, book):
- self.book = book
-
- def by_slug_and_lang(self, slug, language):
- if slug == self.book.slug and language == self.language:
- return open(self.book.xml_file.path)
- else:
- return type(self.book).objects.get(
- slug=slug, language=language).xml_file
-
-