[IMP] adresses massive import perfomrance by doing direct insert into database

This commit is contained in:
unknown
2013-04-11 10:57:53 +02:00
parent 0ef301a199
commit 3ec119eb20
2 changed files with 105 additions and 54 deletions

View File

@@ -29,6 +29,7 @@ try:
except:
raise Exception(_('Please install python lib xlrd'))
def float_or_zero(val):
""" Conversion function used to manage
empty string into float usecase"""
@@ -82,14 +83,12 @@ class GenericFileParser(FileParser):
In this generic parser, the commission is given for every line, so we store it
for each one.
"""
return {
'name': line.get('label', line.get('ref', '/')),
'date': line.get('date', datetime.datetime.now().date()),
'amount': line.get('amount', 0.0),
'ref': line.get('ref', '/'),
'label': line.get('label', ''),
'commission_amount': line.get('commission_amount', 0.0),
}
return {'name': line.get('label', line.get('ref', '/')),
'date': line.get('date', datetime.datetime.now().date()),
'amount': line.get('amount', 0.0),
'ref': line.get('ref', '/'),
'label': line.get('label', ''),
'commission_amount': line.get('commission_amount', 0.0)}
def _post(self, *args, **kwargs):
"""