

def __init__(self, rh, **options):
    self.rh = rh
    self.actor = rh.actor
    self.df2sf = {
        
    }
    self.all_fields = []
    self.list_fields = []
    self.detail_fields = []
    self.primary_keys = set([])

    def addfield(sf):
        self.all_fields.append(sf)
        self.list_fields.append(sf)
        self.detail_fields.append(sf)
    if (not issubclass(rh.actor, frames.Frame)):
        self.collect_fields(self.list_fields, rh.get_list_layout())
    form = rh.actor.detail_layout
    if form:
        dh = form.get_layout_handle(settings.SITE.kernel.default_ui)
        self.collect_fields(self.detail_fields, dh)
    form = rh.actor.insert_layout
    if form:
        dh = form.get_layout_handle(settings.SITE.kernel.default_ui)
        self.collect_fields(self.detail_fields, dh)
    if (self.pk is not None):
        self.pk_index = 0
        found = False
        for fld in self.list_fields:
            "\n                Django's Field.__cmp__() does::\n                \n                  return cmp(self.creation_counter, other.creation_counter)\n                  \n                which causes an exception when trying to compare a field\n                with an object of other type.\n                "
            if ((fld.field.__class__ is self.pk.__class__) and (fld.field == self.pk)):
                found = True
                break
            self.pk_index += fld.list_values_count
        if (not found):
            raise Exception(('Primary key %s not found in list_fields %s' % (self.pk, self.list_fields)))
    del self.df2sf
    if rh.actor.editable:
        addfield(DisabledFieldsStoreField(self))
    addfield(DisabledActionsStoreField(self))
    if rh.actor.editable:
        addfield(DisableEditingStoreField(self))
    if (rh.actor.get_row_classes is not None):
        addfield(RowClassStoreField(self))
    self.all_fields = ([f for f in self.all_fields if (not isinstance(f, VirtStoreField))] + [f for f in self.all_fields if isinstance(f, VirtStoreField)])
    self.all_fields = tuple(self.all_fields)
    self.list_fields = tuple(self.list_fields)
    self.detail_fields = tuple(self.detail_fields)

dataset/ETHPy150Open lsaffre/lino/lino/core/store.py Store.__init__/original