Can anyone tell me how i can limit the choices for the Page model which i inherit from in the following code?
class CaseStudy(Page):
"""
An entry in a fancy picture flow widget for a case study page
"""
image = models.ForeignKey(Image, limit_choices_to={'is_active': True, 'category__code':'RP'})
def __unicode__(self):
return u"%s" % self.title
The django admin is limiting the image choices in a drop down successfully, but i would like to limit a field in the Page model as well (a 'parent page field'), ie:
class Page(models.Model):
parent = models.ForeignKey('self', blank=True, null=True, related_name='children')