Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_value(self, dictionary):
- if html.is_html_input(dictionary) and self.field_name in dictionary:
- # When HTML form input is used, mark up the input
- # as being a JSON string, rather than a JSON primative.
- class JSONString(six.text_type):
- def __new__(self, value):
- ret = six.text_type.__new__(self, value)
- ret.is_json_string = True
- return ret
- return JSONString(dictionary[self.field_name])
- return dictionary.get(self.field_name, empty)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement