class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum, _StringType): (source)
MySQL ENUM type.
Class Method | adapt |
Produce a MySQL native :class:`.mysql.ENUM` from plain :class:`.Enum`. |
Method | __init__ |
Construct an ENUM. |
Method | __repr__ |
Undocumented |
Class Variable | __visit |
Undocumented |
Class Variable | native |
Undocumented |
Method | _object |
Undocumented |
Inherited from NativeForEmulated
:
Class Method | adapt |
Given an impl, adapt this type's class to the impl assuming "emulated". |
Inherited from Enum
(via NativeForEmulated
):
Class |
|
Undocumented |
Method | adapt |
Produce an "adapted" form of this type, given an "impl" class to work with. |
Method | adapt |
Given an impl class, adapt this type to the impl assuming "emulated". |
Method | as |
Return an instance of the generic type corresponding to this type using heuristic rule. The method may be overridden if this heuristic rule is not sufficient. |
Method | bind |
Return a conversion function for processing bind values. |
Method | copy |
Undocumented |
Method | literal |
Return a conversion function for processing literal values that are to be rendered directly without using binds. |
Method | result |
Return a conversion function for processing result row values. |
Instance Variable | create |
Undocumented |
Instance Variable | enum |
Undocumented |
Instance Variable | enums |
Undocumented |
Instance Variable | validate |
Undocumented |
Instance Variable | values |
Undocumented |
Property | native |
Undocumented |
Property | python |
Return the Python type object expected to be returned by instances of this type, if known. |
Property | sort |
A sorting function that can be passed as the key to sorted. |
Method | _db |
Undocumented |
Method | _enum |
internal init for :class:`.Enum` and subclasses. |
Method | _make |
Undocumented |
Method | _parse |
Undocumented |
Method | _resolve |
adjust this type given a literal Python value that will be stored in a bound parameter. |
Method | _resolve |
given a Python type (e.g. ``int``, ``str``, etc. ) return an instance of this :class:`.TypeEngine` that's appropriate for this type. |
Method | _set |
Undocumented |
Method | _setup |
Undocumented |
Method | _should |
Undocumented |
Instance Variable | _default |
Undocumented |
Instance Variable | _object |
Undocumented |
Instance Variable | _omit |
Undocumented |
Instance Variable | _sort |
Undocumented |
Instance Variable | _valid |
Undocumented |
Property | _enums |
Undocumented |
Inherited from _StringType
(via NativeForEmulated
, Enum
):
Instance Variable | ascii |
Undocumented |
Instance Variable | binary |
Undocumented |
Instance Variable | charset |
Undocumented |
Instance Variable | national |
Undocumented |
Instance Variable | unicode |
Undocumented |
Inherited from String
(via NativeForEmulated
, Enum
, _StringType
):
Method | get |
Return the corresponding type object from the underlying DB-API, if any. |
Instance Variable | collation |
Undocumented |
Instance Variable | length |
Undocumented |
Inherited from SchemaType
(via NativeForEmulated
, Enum
, _StringType
, String
, Concatenable
):
Method | create |
Issue CREATE DDL for this type, if applicable. |
Method | drop |
Issue DROP DDL for this type, if applicable. |
Instance Variable | dispatch |
Undocumented |
Instance Variable | inherit |
Undocumented |
Instance Variable | metadata |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | schema |
Undocumented |
Method | _is |
Undocumented |
Method | _on |
Undocumented |
Method | _on |
Undocumented |
Method | _on |
Undocumented |
Method | _on |
Undocumented |
Method | _set |
Associate with this SchemaEvent's parent object. |
Method | _variant |
Undocumented |
Class Variable | _use |
Undocumented |
Instance Variable | _create |
Undocumented |
Inherited from SchemaEventTarget
(via NativeForEmulated
, Enum
, _StringType
, String
, Concatenable
, SchemaType
):
Method | _set |
Undocumented |
Inherited from EventTarget
(via NativeForEmulated
, Enum
, _StringType
, String
, Concatenable
, SchemaType
, SchemaEventTarget
):
Class Variable | __slots__ |
Undocumented |
Inherited from TypeEngineMixin
(via NativeForEmulated
, Enum
, _StringType
, String
, Concatenable
, SchemaType
, SchemaEventTarget
, EventTarget
, Emulated
):
Method | dialect |
Undocumented |
Property | _static |
Undocumented |
Inherited from TypeEngine
(via NativeForEmulated
, Enum
, _StringType
, String
, Concatenable
, SchemaType
, SchemaEventTarget
, EventTarget
, Emulated
, TypeEngineMixin
):
Method | __str__ |
Undocumented |
Method | bind |
Given a bind value (i.e. a :class:`.BindParameter` instance), return a SQL expression in its place. |
Method | coerce |
Suggest a type for a 'coerced' Python value in an expression. |
Method | column |
Given a SELECT column expression, return a wrapping SQL expression. |
Method | compare |
Compare this type against the given backend type. |
Method | compare |
Compare two values for equality. |
Method | compile |
Produce a string-compiled form of this :class:`.TypeEngine`. |
Method | copy |
Undocumented |
Method | evaluates |
Return a copy of this type which has the :attr:`.should_evaluate_none` flag set to True. |
Method | with |
Produce a copy of this type object that will utilize the given type when applied to the dialect of the given name. |
Class Variable | hashable |
Flag, if False, means values from this type aren't hashable. |
Class Variable | render |
Render bind casts for :attr:`.BindTyping.RENDER_CASTS` mode. |
Class Variable | render |
render casts when rendering a value as an inline literal, e.g. with :meth:`.TypeEngine.literal_processor`. |
Class Variable | should |
If True, the Python constant ``None`` is considered to be handled explicitly by this type. |
Static Method | _to |
Undocumented |
Method | _cached |
Return a dialect-specific bind processor for this type. |
Method | _cached |
return a dialect-specific processing object for custom purposes. |
Method | _cached |
Return a dialect-specific literal processor for this type. |
Method | _cached |
Return a dialect-specific result processor for this type. |
Method | _compare |
Undocumented |
Method | _default |
Undocumented |
Method | _dialect |
Return a dialect-specific registry which caches a dialect-specific implementation, bind processing function, and one or more result processing functions. |
Method | _gen |
Undocumented |
Method | _unwrapped |
Return the 'unwrapped' dialect impl for this type. |
Class Variable | _is |
Undocumented |
Class Variable | _is |
Undocumented |
Class Variable | _is |
Undocumented |
Class Variable | _is |
Undocumented |
Class Variable | _isnull |
Undocumented |
Class Variable | _sqla |
Undocumented |
Property | _generic |
Undocumented |
Property | _has |
memoized boolean, check if bind_expression is implemented. |
Property | _has |
memoized boolean, check if column_expression is implemented. |
Property | _type |
Return a rudimental 'affinity' value expressing the general class of type. |
Inherited from Visitable
(via NativeForEmulated
, Enum
, _StringType
, String
, Concatenable
, SchemaType
, SchemaEventTarget
, EventTarget
, Emulated
, TypeEngineMixin
, TypeEngine
):
Method | __class |
Undocumented |
Method | __init |
Undocumented |
Class Method | _generate |
Undocumented |
Method | _compiler |
Undocumented |
Class Variable | _original |
Undocumented |
sqlalchemy.sql.sqltypes.Enum.__init__
Construct an ENUM. E.g.:: Column('myenum', ENUM("foo", "bar", "baz")) :param enums: The range of valid values for this ENUM. Values in enums are not quoted, they will be escaped and surrounded by single quotes when generating the schema. This object may also be a PEP-435-compliant enumerated type. .. versionadded: 1.1 added support for PEP-435-compliant enumerated types. :param strict: This flag has no effect. .. versionchanged:: The MySQL ENUM type as well as the base Enum type now validates all Python data values. :param charset: Optional, a column-level character set for this string value. Takes precedence to 'ascii' or 'unicode' short-hand. :param collation: Optional, a column-level collation for this string value. Takes precedence to 'binary' short-hand. :param ascii: Defaults to False: short-hand for the ``latin1`` character set, generates ASCII in schema. :param unicode: Defaults to False: short-hand for the ``ucs2`` character set, generates UNICODE in schema. :param binary: Defaults to False: short-hand, pick the binary collation type that matches the column's character set. Generates BINARY in schema. This does not affect the type of data stored, only the collation of character data.