2021-04-29 13:17:21 +00:00
|
|
|
from owrx.form.input.converter import Converter
|
2021-02-08 19:30:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ReceiverKeysConverter(Converter):
|
|
|
|
def convert_to_form(self, value):
|
2021-02-18 14:27:05 +00:00
|
|
|
return "" if value is None else "\n".join(value)
|
2021-02-08 19:30:12 +00:00
|
|
|
|
|
|
|
def convert_from_form(self, value):
|
|
|
|
# \r\n or \n? this should work with both.
|
|
|
|
return [v.strip("\r ") for v in value.split("\n")]
|