r"""A Unicode subclass to validate separate_in, separate_out, etc. This is a Unicode based trait that converts '0'->'' and ``'\\n'->'\n'``.
| 263 | |
| 264 | |
| 265 | class SeparateUnicode(Unicode): |
| 266 | r"""A Unicode subclass to validate separate_in, separate_out, etc. |
| 267 | |
| 268 | This is a Unicode based trait that converts '0'->'' and ``'\\n'->'\n'``. |
| 269 | """ |
| 270 | |
| 271 | def validate(self, obj, value): |
| 272 | if value == '0': value = '' |
| 273 | value = value.replace('\\n','\n') |
| 274 | return super(SeparateUnicode, self).validate(obj, value) |
| 275 | |
| 276 | |
| 277 | @undoc |