Reviewers: ,


Please review this at http://codereview.tryton.org/210001/

Affected files:
  M CHANGELOG
  M trytond/pyson.py


Index: CHANGELOG
===================================================================
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+* Add pyson.Id
+
 Version 2.2.0 - 2011-10-24
 * Bug fixes (see mercurial logs for details)
 * Remove name field in ir.property
Index: trytond/pyson.py
===================================================================
--- a/trytond/pyson.py
+++ b/trytond/pyson.py
@@ -533,6 +533,23 @@
         datetime_ += datetime.timedelta(**delta)
         return datetime_

+
+class Id(PYSON):
+    """The database id for filesystem id"""
+
+    def __init__(self, module, fs_id):
+        super(Id, self).__init__()
+        self._module = module
+        self._fs_id = fs_id
+
+    def pyson(self):
+        from trytond.pool import Pool
+        model_data_obj = Pool().get('ir.model.data')
+        return model_data_obj.get_id(self._module, self._fs_id)
+
+    def types(self):
+        return set([int])
+
 CONTEXT = {
     'Eval': Eval,
     'Not': Not,


--
[email protected] mailing list

Reply via email to