Added config folder with TSV columns for each model
This commit is contained in:
parent
a4473cc7d0
commit
ad7949805d
|
@ -1 +1 @@
|
|||
id name category
|
||||
id name category_id.name
|
|
|
@ -37,6 +37,12 @@ def csv( *fields ):
|
|||
def json( obj ):
|
||||
print( JSON.dumps(obj, indent=4) ) #"\t") )
|
||||
|
||||
def get_at_path( obj, prop ):
|
||||
path = prop.split('.')
|
||||
cur = obj
|
||||
for key in path:
|
||||
cur = cur[key]
|
||||
return cur
|
||||
|
||||
def render_tsv( model, list ):
|
||||
|
||||
|
@ -48,7 +54,7 @@ def render_tsv( model, list ):
|
|||
tsv( *_cols )
|
||||
|
||||
for obj in list:
|
||||
tsv( *[ obj[col] for col in _cols] )
|
||||
tsv( *[ get_at_path(obj,col) for col in _cols] )
|
||||
|
||||
def render_csv( model, list ):
|
||||
|
||||
|
|
Loading…
Reference in New Issue