Added config folder with TSV columns for each model
This commit is contained in:
parent
113c5bf2b0
commit
a4473cc7d0
|
@ -14,11 +14,14 @@ with open(".modelignore", "r") as file:
|
||||||
|
|
||||||
|
|
||||||
conf_files = os.listdir( CONFDIR )
|
conf_files = os.listdir( CONFDIR )
|
||||||
keyword = 'your_keyword'
|
COLS = {
|
||||||
|
'': [ 'id', 'name', 'create_uid' ], # default
|
||||||
|
}
|
||||||
|
|
||||||
for file in conf_files:
|
for file in conf_files:
|
||||||
if os.path.isfile( os.path.join(CONFDIR,file) ):
|
if os.path.isfile( os.path.join(CONFDIR,file) ):
|
||||||
if file.endswith('.tsv'):
|
if file.endswith('.tsv'):
|
||||||
eprint( 'Conf file: ', file )
|
# eprint( 'Conf file: ', file )
|
||||||
f = open( os.path.join(CONFDIR,file), 'r' )
|
f = open( os.path.join(CONFDIR,file), 'r' )
|
||||||
eprint( file[:-4], f.split() )
|
COLS[file[:-4]] = f.read().split()
|
||||||
f.close()
|
f.close()
|
24
renderers.py
24
renderers.py
|
@ -1,12 +1,14 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import json as JSON
|
import json as JSON
|
||||||
|
from config import *
|
||||||
|
|
||||||
# TABLE VIEW COLUMNS
|
# TABLE VIEW COLUMNS
|
||||||
cols = {
|
# cols = {
|
||||||
'': [ 'id', 'name', 'create_uid' ], # default
|
# '': [ 'id', 'name', 'create_uid' ], # default
|
||||||
'ir.model': [ 'id', 'model' ],
|
# 'ir.model': [ 'id', 'model' ],
|
||||||
'ir.model.fields': [ 'id', 'name', 'ttype', 'create_uid', 'relation', 'display_name', 'complete_name' ],
|
# 'ir.model.fields': [ 'id', 'name', 'ttype', 'create_uid', 'relation', 'display_name', 'complete_name' ],
|
||||||
}
|
# 'ir.module.module': [ 'id', 'name', 'display_name', 'application', 'write_uid', 'write_date', 'dependencies_id' ],
|
||||||
|
# }
|
||||||
|
|
||||||
import os
|
import os
|
||||||
# import locale
|
# import locale
|
||||||
|
@ -38,10 +40,10 @@ def json( obj ):
|
||||||
|
|
||||||
def render_tsv( model, list ):
|
def render_tsv( model, list ):
|
||||||
|
|
||||||
if model in cols:
|
if model in COLS:
|
||||||
_cols = cols[model]
|
_cols = COLS[model]
|
||||||
else:
|
else:
|
||||||
_cols = cols['']
|
_cols = COLS['']
|
||||||
|
|
||||||
tsv( *_cols )
|
tsv( *_cols )
|
||||||
|
|
||||||
|
@ -50,10 +52,10 @@ def render_tsv( model, list ):
|
||||||
|
|
||||||
def render_csv( model, list ):
|
def render_csv( model, list ):
|
||||||
|
|
||||||
if model in cols:
|
if model in COLS:
|
||||||
_cols = cols[model]
|
_cols = COLS[model]
|
||||||
else:
|
else:
|
||||||
_cols = cols['']
|
_cols = COLS['']
|
||||||
|
|
||||||
csv( *_cols )
|
csv( *_cols )
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue