File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ def _get_flds(tbl):
81
81
def _dataclass (self :Table , store = True , suf = '' )-> type :
82
82
"Create a `dataclass` with the types and defaults of this table"
83
83
res = make_dataclass (self .name .title ()+ suf , _get_flds (self ))
84
+ flexiclass (res )
84
85
if store : self .cls = res
85
86
return res
86
87
@@ -154,7 +155,7 @@ def create(
154
155
strict = False , # Apply STRICT mode to table
155
156
):
156
157
"Create table from `cls`, default name to snake-case version of class name"
157
- mk_dataclass (cls )
158
+ flexiclass (cls )
158
159
if name is None : name = camel2snake (cls .__name__ )
159
160
typs = {o .name : o .type for o in fields (cls )}
160
161
res = self .create_table (
Original file line number Diff line number Diff line change 371
371
" def _dataclass(self:Table, store=True, suf='')->type:\n " ,
372
372
" \" Create a `dataclass` with the types and defaults of this table\"\n " ,
373
373
" res = make_dataclass(self.name.title()+suf, _get_flds(self))\n " ,
374
+ " flexiclass(res)\n " ,
374
375
" if store: self.cls = res\n " ,
375
376
" return res\n " ,
376
377
" \n " ,
770
771
" strict=False, # Apply STRICT mode to table\n " ,
771
772
" ):\n " ,
772
773
" \" Create table from `cls`, default name to snake-case version of class name\"\n " ,
773
- " mk_dataclass (cls)\n " ,
774
+ " flexiclass (cls)\n " ,
774
775
" if name is None: name = camel2snake(cls.__name__)\n " ,
775
776
" typs = {o.name: o.type for o in fields(cls)}\n " ,
776
777
" res = self.create_table(\n " ,
797
798
{
798
799
"data" : {
799
800
"text/plain" : [
800
- " Cat(id=1, name=None , age=None , city='Unknown')"
801
+ " Cat(id=1, name=UNSET , age=UNSET , city='Unknown')"
801
802
]
802
803
},
803
804
"execution_count" : null ,
You can’t perform that action at this time.
0 commit comments