MCPcopy
hub / github.com/django/django / quote_value

Method quote_value

django/db/backends/mysql/schema.py:43–51  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

41 return "ALTER TABLE %(table)s DROP CHECK %(name)s"
42
43 def quote_value(self, value):
44 self.connection.ensure_connection()
45 # MySQLdb escapes to string, PyMySQL to bytes.
46 quoted = self.connection.connection.escape(
47 value, self.connection.connection.encoders
48 )
49 if isinstance(value, str) and isinstance(quoted, bytes):
50 quoted = quoted.decode()
51 return quoted
52
53 def _is_limited_data_type(self, field):
54 db_type = field.db_type(self.connection)

Callers 5

_set_field_new_typeMethod · 0.95
_get_condition_sqlMethod · 0.45
_get_check_sqlMethod · 0.45
_get_condition_sqlMethod · 0.45
test_quote_valueMethod · 0.45

Calls 2

ensure_connectionMethod · 0.80
decodeMethod · 0.45

Tested by 1

test_quote_valueMethod · 0.36