Commit 77c787ba authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

Fix display of 'compressed' attribute of a binary data object

parent 6a2991d3a896
......@@ -23,6 +23,10 @@ msgstr ""
msgid ", of relationship type %s"
msgstr ""
#, python-brace-format
msgid ", using {algorithm}"
msgstr ""
msgid "0..1"
msgstr ""
......
......@@ -23,6 +23,10 @@ msgstr ", type de relation libre"
msgid ", of relationship type %s"
msgstr ", de type %s"
#, python-brace-format
msgid ", using {algorithm}"
msgstr ", avec l'algorithme {algorithm}"
msgid "0..1"
msgstr "facultatif et unique (0..1)"
......
......@@ -132,6 +132,10 @@ rec.tag_subject_of(('SEDABinaryDataObject', 'seda_alt_binary_data_object_attachm
{'rvid': 'seda.reledit.alternative',
'novalue_label': _('<unauthorized>')})
rec.tag_object_of(('*', 'seda_compressed', '*'),
{'rvid': 'seda.reledit.text',
'novalue_label': _('<unauthorized>')})
def uri_cardinality_vocabulary(form, field):
req = form._cw
......@@ -276,6 +280,20 @@ class RelationshipBusinessValueLinkEntityView(viewlib.BusinessValueLinkEntityVie
return value
class CompressedBusinessValueEntityView(viewlib.BusinessValueEntityView):
__select__ = is_instance('SEDACompressed')
def entity_value(self, entity):
if entity.compressed is None:
value = self._cw.__('indifferent')
else:
value = self._cw.__('yes' if entity.compressed else 'no')
if entity.seda_algorithm:
algorithm = entity.seda_algorithm[0].label()
value += self._cw._(u', using {algorithm}').format(algorithm=algorithm)
return value
class RelationshipReverseEntityView(view.EntityView):
__regid__ = 'seda.relationship.reverse'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment