@classmethod
    def from_instance(cls, instance):
        ret = cls()
        ret.update(instance)
        return ret
Factory method for creating these objects from an instance doc
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/sofabed/models.py/BaseDataIndex.from_instance