def _to_data(self):
    def getval(fld):
        val = getattr(self, fld.name, _NO_VAL)
        if val == _NO_VAL:
            val = fld.get_default_val()
        return val

    # Update the datetime fields that we add automatically
    now = now_field()
    setattr(self, '_last_update', now)
    if not getattr(self, '_create_date', ''):
        setattr(self, '_create_date', now)

    data = dict([(fld.name, getval(fld)) for fld in self.__fields__])

    return json.dumps(data)
dataset/ETHPy150Open memphis-iis/GLUDB/gludb/simple.py/_to_data/operator `is` -> `==`