pow_devel icon indicating copy to clipboard operation
pow_devel copied to clipboard

Add option to Toggle using the pow schema extensions to all models

Open pythononwheels opened this issue 6 years ago • 1 comments

currently available for SQL Models to use SQL refelction: see here

Toggle using the pow schema extensions (id, created_at, last_updated)

_use_pow_schema_attrs = False

pythononwheels avatar Sep 26 '19 08:09 pythononwheels

Something like:

            if getattr(self.__class__,'_use_pow_schema_attrs', False):
                self.basic_schema = {
                    "_uuid" :  { "type" : "string", "default" : str(uuid.uuid4()) },
                    #"eid"   :   { "type" : "string" },
                    "created_at"    : { "type" : "datetime" },
                    "last_updated"    : { "type" : "datetime" },
                }
            else:
                self.basic_schema = {}

## And then merge the two dicts schema & basic_schema.

pythononwheels avatar Sep 26 '19 08:09 pythononwheels