0
다음 코드에서 상속받은 페이지 모델의 선택을 어떻게 제한 할 수 있습니까? 즉,Django 모델 상속 및 limit_choices_to
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
은 장고 관리자는 아래 성공적으로 드롭 이미지 선택을 제한하고,하지만 난뿐만 아니라 (A '상위 페이지 필드') 페이지 모델에서 필드를 제한하려는 :
class Page(models.Model):
parent = models.ForeignKey('self', blank=True, null=True, related_name='children')