from django.db import models

def get_prepared_date(cls):
    return cls.prepared_date or cls.parent.prepared_date

def register(cls, admin_cls):
    cls.add_to_class('prepared_date', models.TextField('Date of Preparation', blank=True, null=True))
    cls.add_to_class('get_prepared_date', get_prepared_date)


@@ -27,94 +27,8 @@
 ls%0A%0A
-def get_prepared_date(cls):%0A    return cls.prepared_date or cls.parent.prepared_date%0A%0A
 def 
@@ -75,16 +75,17 @@
 _class('
+_
 prepared
@@ -160,53 +160,488 @@
 e))%0A
+%0A
     
-cls.add_to_class('get_prepared_date', get
+def getter():%0A        if not cls._prepared_date:%0A            try:%0A                return cls.get_ancestors(ascending=True).filter(_prepared_date__isnull=False)%5B0%5D._prepared_date%0A            except IndexError:%0A                return None%0A        return cls._prepared_date%0A%0A    def setter(value):%0A        cls._prepared_date = value%0A%0A    cls.prepared_date = property(getter, setter)%0A%0A    if admin_cls and admin_cls.fieldsets:%0A        admin_cls.fieldsets%5B2%5D%5B1%5D%5B'fields'%5D.append('
 _pre
@@ -650,11 +650,12 @@
 red_date
+'
 )%0A%0A

Return parent date if there isn't one on the current object