I'm tinkering with this branch locally at the moment - will try and get the
good stuff out of @andrewhayward and @madewithbytes stuff into it.

The potential for infinite loops seems a bit worrying but having had a
brief play around I've not been able to trigger it yet. As the people using
this are likely to be Matt and other MoFo staff, and that the pages output
from it are pretty temporary I think it's a risk that we can take.


On Mon, Mar 4, 2013 at 2:05 PM, Andrew Hayward <notifications@github.com>wrote:

> In make_mozilla/pages/models.py:
>
> >      show_subnav = models.BooleanField(default=False,
> >          verbose_name='Show sub-navigation menu')
> >      subnav_title = models.CharField(max_length=100, blank=True, null=True,
> >          verbose_name='Menu title', help_text='This can be left blank if you do not need a title')
> >      additional_content = models.TextField(blank=True, null=True)
> >
> > +    def has_ancestor(self, page):
> > +        if not self.parent:
> > +            return False
> > +        if self.parent.id == page.id:
> > +            return True
> > +        return self.parent.has_ancestor(page)
> > +
> > +    def clean(self):
> > +        from django.core.exceptions import ValidationError
>
> I didn't even think about it, to be honest - just copied the stub from the
> Django docs<https://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.clean>and did what needed to be done! But yes, noted; this should be at the top
> of the file.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mozilla/make.mozilla.org/pull/95/files#r3224214>
> .
>