Fixes python objects so that they can be properly inserted into SQL queries
(value)
| 135 | |
| 136 | |
| 137 | def fix_object(value): |
| 138 | """Fixes python objects so that they can be properly inserted into SQL queries""" |
| 139 | if isinstance(value, set): |
| 140 | value = ','.join(value) |
| 141 | if PY3PLUS and isinstance(value, bytes): |
| 142 | return value.decode('utf-8') |
| 143 | elif not PY3PLUS and isinstance(value, unicode): |
| 144 | return value.encode('utf-8') |
| 145 | else: |
| 146 | return value |
| 147 | |
| 148 | |
| 149 | def is_dml_event(event): |
no outgoing calls