@classmethod
    def super_entity(cls, tablename, key, types, *fields, **args):

        db = current.db
        if db._dbname == "postgres":
            sequence_name = "%s_%s_seq" % (tablename, key)
        else:
            sequence_name = None

        table = db.define_table(tablename,
                                Field(key, "id",
                                      readable=False,
                                      writable=False),
                                Field("deleted", "boolean",
                                      readable=False,
                                      writable=False,
                                      default=False),
                                Field("instance_type",
                                      represent = lambda opt: \
                                        types.get(opt, opt) or \
                                            current.messages["NONE"],
                                      readable=False,
                                      writable=False),
                                Field("uuid", length=128,
                                      readable=False,
                                      writable=False),
                                sequence_name=sequence_name,
                                *fields, **args)

        return table

    # -------------------------------------------------------------------------
Define a super-entity table
dataset/ETHPy150Open sahana/eden/modules/s3/s3model.py/S3Model.super_entity