Skip to content

Commit 4d22514

Browse files
committed
Add zero_width_space to as_html
1 parent e79b0d1 commit 4d22514

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

_CNDB/_GTW/RST_addons.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@
115115
# 12-Jun-2015 (CT) Add action `change_email`, remove action `reset_password`
116116
# 24-Jun-2015 (CT) Derive `DB_Wire{d,less}_Interface` from `DB_Interface`,
117117
# not `_DB_Interface_`
118+
# 24-Jun-2015 (CT) Add `zero_width_space` to `as_html` (_Field_IP_Address_,
119+
# _Field_IP_Addresses_, _Field_IP_Network_)
118120
# ««revision-date»»···
119121
#--
120122

@@ -141,6 +143,7 @@
141143

142144
from _TFL._Meta.Once_Property import Once_Property
143145
from _TFL.Decorator import getattr_safe, Add_New_Method, Decorator
146+
from _TFL.Dingbats import zero_width_space
144147
from _TFL.formatted_repr import formatted_repr as formatted
145148
from _TFL.I18N import _, _T, _Tn
146149
from _TFL.predicate import filtered_join
@@ -893,6 +896,12 @@ def ui_name (self) :
893896
return _T ("IP address")
894897
# end def ui_name
895898

899+
def as_html (self, o, renderer) :
900+
result = self.__super.as_html (o, renderer)
901+
result = result.replace (".", zero_width_space + ".")
902+
return result
903+
# end def as_html
904+
896905
# end class _Field_IP_Address_
897906

898907
class _Field_IP_Addresses_ (Field) :
@@ -922,7 +931,7 @@ def as_html (self, o, renderer) :
922931

923932
def value (self, o, renderer) :
924933
return ", ".join \
925-
( str (nw.net_address)
934+
( str (nw.net_address).replace (".", zero_width_space + ".")
926935
for nw in ichain (o.ip4_networks, o.ip6_networks)
927936
)
928937
# end def value
@@ -937,6 +946,12 @@ def ui_name (self) :
937946
return _T ("IP network")
938947
# end def ui_name
939948

949+
def as_html (self, o, renderer) :
950+
result = self.__super.as_html (o, renderer)
951+
result = result.replace (".", zero_width_space + ".")
952+
return result
953+
# end def as_html
954+
940955
# end class _Field_IP_Network_
941956

942957
class _Field_Node_ (_Field_Ref_) :

0 commit comments

Comments
 (0)