From e8af083d9bf2d7243bb04cf43504dcc2aa3ac55c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 3 Jun 2008 12:09:12 +0200 Subject: [PATCH] Remove unused list_class stuff --- trytond/osv/orm.py | 21 ++++++++------------- trytond/report/report.py | 1 - trytond/wizard/wizard.py | 2 +- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index 905003a5b9..0cd5730b66 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -42,13 +42,11 @@ browse_record_list = BrowseRecordList class BrowseRecord(object): - def __init__(self, cursor, user, object_id, table, cache, context=None, - list_class=None): + def __init__(self, cursor, user, object_id, table, cache, context=None): ''' table : the object (inherited from orm) context : a dictionnary with an optionnal context ''' - self._list_class = list_class or BrowseRecordList self._cursor = cursor self._user = user self._id = object_id @@ -116,13 +114,11 @@ class BrowseRecord(object): ids2 = data[i] data[i] = BrowseRecord(self._cursor, self._user, ids2, obj, self._cache, - context=self._context, - list_class=self._list_class) + context=self._context) elif j._type in ('one2many', 'many2many') and len(data[i]): - data[i] = self._list_class([BrowseRecord(self._cursor, + data[i] = BrowseRecordList([BrowseRecord(self._cursor, self._user, x, obj, - self._cache, context=self._context, - list_class=self._list_class) for x in data[i]], + self._cache, context=self._context) for x in data[i]], self._context) self._data[data['id']].update(data) return self._data[self._id][name] @@ -804,20 +800,19 @@ class ORM(object): ''' return None - def browse(self, cursor, user, select, context=None, list_class=None): + def browse(self, cursor, user, select, context=None): ''' Return a browse a BrowseRecordList for the select ids or BrowseRecord if select is a integer. ''' - list_class = list_class or BrowseRecordList cache = {} # need to accepts ints and longs because ids coming from a method # launched by button in the interface have a type long... if isinstance(select, (int, long)): return BrowseRecord(cursor, user, select, self, cache, - context=context, list_class=list_class) - return list_class([BrowseRecord(cursor, user, x, self, cache, - context=context, list_class=list_class) for x in select], + context=context) + return BrowseRecordList([BrowseRecord(cursor, user, x, self, cache, + context=context) for x in select], context) def __export_row(self, cursor, user, row, fields_names, context=None): diff --git a/trytond/report/report.py b/trytond/report/report.py index 88e9c7610e..386d052c09 100644 --- a/trytond/report/report.py +++ b/trytond/report/report.py @@ -220,7 +220,6 @@ class Report(object): context = context.copy() if 'language' in context: del context['language'] - #TODO change list_class return model_obj.browse(cursor, user, ids, context=context) def parse(self, cursor, user, report, objects, datas, context): diff --git a/trytond/wizard/wizard.py b/trytond/wizard/wizard.py index 5b17a63bcc..9d8286485c 100644 --- a/trytond/wizard/wizard.py +++ b/trytond/wizard/wizard.py @@ -239,7 +239,7 @@ class WizardOSV(OSV): def init(self, cursor): pass - def browse(self, cursor, user, select, context=None, list_class=None): + def browse(self, cursor, user, select, context=None): pass def export_data(self, cursor, user, ids, fields_name, context=None):