'Returns all children documents from **Table** type field in a list.'

def get_all_children(self, parenttype=None):

    ret = []
    for df in self.meta.get(u'fields', {u'fieldtype': u'Table'}):
        if parenttype:
            if (df.options == parenttype):
                return self.get(df.fieldname)
        value = self.get(df.fieldname)
        if isinstance(value, list):
            ret.extend(value)
    return ret
