Added public OID attribute to interface
authorThierry Florac <thierry.florac@onf.fr>
Tue, 28 Aug 2018 17:54:11 +0200
changeset 65 7a5bb2cb45d2
parent 64 f6dedcd5fb70
child 66 e5279f804dea
Added public OID attribute to interface
src/pyams_sequence/interfaces/__init__.py
src/pyams_sequence/sequence.py
--- a/src/pyams_sequence/interfaces/__init__.py	Mon Aug 27 11:48:25 2018 +0200
+++ b/src/pyams_sequence/interfaces/__init__.py	Tue Aug 28 17:54:11 2018 +0200
@@ -73,6 +73,9 @@
     hex_oid = TextLine(title=_("Unique ID"),
                        required=False)
 
+    public_oid = TextLine(title=_("Unique ID"),
+                          readonly=True)
+
     def get_full_oid(self):
         """Get full OID"""
 
--- a/src/pyams_sequence/sequence.py	Mon Aug 27 11:48:25 2018 +0200
+++ b/src/pyams_sequence/sequence.py	Tue Aug 28 17:54:11 2018 +0200
@@ -45,6 +45,10 @@
         sequence = get_utility(ISequentialIntIds)
         return sequence.get_base_oid(self.oid)
 
+    @property
+    def public_oid(self):
+        return self.get_short_oid()
+
 
 SEQUENCE_INFO_KEY = 'pyams_sequence.info'