pythononwheels / pow_devel

development repo for PyhtonOnWheels framework
www.pythononwheels.org
MIT License
75 stars 10 forks source link

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

Open pythononwheels opened 5 years ago

pythononwheels commented 5 years ago

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 commented 5 years ago

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.