[IMP]import_google : Improvement in get_data()

bzr revid: dbr@tinyerp.com-20110621092255-opxr9s421w1ezfo8
This commit is contained in:
DBR (OpenERP) 2011-06-21 14:52:55 +05:30
parent db1f14b1d3
commit be640d3a1f
1 changed files with 7 additions and 13 deletions

View File

@ -67,19 +67,13 @@ class google_import(import_framework):
}
def get_data(self, table):
if table == "Contact":
val = {
self.TABLE_CONTACT: self.get_contact(),
}
if table == "Address":
val = {
self.TABLE_ADDRESS: self.get_contact(),
}
elif table == "Events":
val = {
self.TABLE_EVENT: self.get_events(),
}
return val.get(table)
data_fetching_function = {
self.TABLE_CONTACT: self.get_contact,
self.TABLE_ADDRESS: self.get_contact,
self.TABLE_EVENT: self.get_events,
}
return data_fetching_function.get(table)()
def _get_tinydates(self, stime, etime,context):