For SyDjango Oct 2015 I presented a talk on the core features of Mezzanine and how they're implemented using Django. The aim was to demonstrate the simplicity of Mezzanine, and show the audience how they could build their own CMS using Django.
parent_id = page.parent_id if parent_id not in pages: pages[parent_id] = [] pages[parent_id].append(page) def show_branch(parent_id, depth=0): for page in pages[parent_id]: print (" " * depth) + page.title if page.id in pages: show_branch(page.id, depth + 1)
= self._meta.object_name super(Page, self).save(*args, **kwargs) def get_content_model(self): return getattr(self, self.content_model) @staticmethod def get_content_models(): return [m for m in get_models() if m is not Page and issubclass(m, Page)]