default_factory: Union[_NoArg, Callable[[], _T]] = _NoArg.NO_ARG,
compare: Union[_NoArg, bool] = _NoArg.NO_ARG,
kw_only: Union[_NoArg, bool] = _NoArg.NO_ARG,
+ hash: Union[_NoArg, bool, None] = _NoArg.NO_ARG, # noqa: A002
nullable: Optional[
Union[bool, Literal[SchemaConst.NULL_UNSPECIFIED]]
] = SchemaConst.NULL_UNSPECIFIED,
:ref:`orm_declarative_native_dataclasses`, indicates if this field
should be marked as keyword-only when generating the ``__init__()``.
+ :param hash: Specific to
+ :ref:`orm_declarative_native_dataclasses`, controls if this field
+ is included when generating the ``__hash__()`` method for the mapped
+ class.
+
+ .. versionadded:: 2.0.36
+
:param \**kw: All remaining keyword arguments are passed through to the
constructor for the :class:`_schema.Column`.
autoincrement=autoincrement,
insert_default=insert_default,
attribute_options=_AttributeOptions(
- init, repr, default, default_factory, compare, kw_only
+ init, repr, default, default_factory, compare, kw_only, hash
),
doc=doc,
key=key,
deferred: bool = False,
raiseload: bool = False,
comparator_factory: Optional[Type[PropComparator[_T]]] = None,
- init: Union[_NoArg, bool] = _NoArg.NO_ARG, # noqa: A002
+ init: Union[_NoArg, bool] = _NoArg.NO_ARG,
repr: Union[_NoArg, bool] = _NoArg.NO_ARG, # noqa: A002
default: Optional[Any] = _NoArg.NO_ARG,
default_factory: Union[_NoArg, Callable[[], _T]] = _NoArg.NO_ARG,
compare: Union[_NoArg, bool] = _NoArg.NO_ARG,
kw_only: Union[_NoArg, bool] = _NoArg.NO_ARG,
+ hash: Union[_NoArg, bool, None] = _NoArg.NO_ARG, # noqa: A002
active_history: bool = False,
expire_on_flush: bool = True,
info: Optional[_InfoType] = None,
:ref:`orm_queryguide_deferred_raiseload`
- :param init:
+ :param init: Specific to :ref:`orm_declarative_native_dataclasses`,
+ specifies if the mapped attribute should be part of the ``__init__()``
+ method as generated by the dataclass process.
+ :param repr: Specific to :ref:`orm_declarative_native_dataclasses`,
+ specifies if the mapped attribute should be part of the ``__repr__()``
+ method as generated by the dataclass process.
+ :param default_factory: Specific to
+ :ref:`orm_declarative_native_dataclasses`,
+ specifies a default-value generation function that will take place
+ as part of the ``__init__()``
+ method as generated by the dataclass process.
+
+ .. seealso::
+
+ :ref:`defaults_default_factory_insert_default`
- :param default:
+ :paramref:`_orm.mapped_column.default`
- :param default_factory:
+ :paramref:`_orm.mapped_column.insert_default`
- :param kw_only:
+ :param compare: Specific to
+ :ref:`orm_declarative_native_dataclasses`, indicates if this field
+ should be included in comparison operations when generating the
+ ``__eq__()`` and ``__ne__()`` methods for the mapped class.
+
+ .. versionadded:: 2.0.0b4
+
+ :param kw_only: Specific to
+ :ref:`orm_declarative_native_dataclasses`, indicates if this field
+ should be marked as keyword-only when generating the ``__init__()``.
+
+ :param hash: Specific to
+ :ref:`orm_declarative_native_dataclasses`, controls if this field
+ is included when generating the ``__hash__()`` method for the mapped
+ class.
+
+ .. versionadded:: 2.0.36
"""
return MappedSQLExpression(
default_factory,
compare,
kw_only,
+ hash,
),
group=group,
deferred=deferred,
default_factory: Union[_NoArg, Callable[[], _T]] = _NoArg.NO_ARG,
compare: Union[_NoArg, bool] = _NoArg.NO_ARG,
kw_only: Union[_NoArg, bool] = _NoArg.NO_ARG,
+ hash: Union[_NoArg, bool, None] = _NoArg.NO_ARG, # noqa: A002
info: Optional[_InfoType] = None,
doc: Optional[str] = None,
**__kw: Any,
default_factory: Union[_NoArg, Callable[[], _T]] = _NoArg.NO_ARG,
compare: Union[_NoArg, bool] = _NoArg.NO_ARG,
kw_only: Union[_NoArg, bool] = _NoArg.NO_ARG,
+ hash: Union[_NoArg, bool, None] = _NoArg.NO_ARG, # noqa: A002
info: Optional[_InfoType] = None,
doc: Optional[str] = None,
**__kw: Any,
default_factory: Union[_NoArg, Callable[[], _T]] = _NoArg.NO_ARG,
compare: Union[_NoArg, bool] = _NoArg.NO_ARG,
kw_only: Union[_NoArg, bool] = _NoArg.NO_ARG,
+ hash: Union[_NoArg, bool, None] = _NoArg.NO_ARG, # noqa: A002
info: Optional[_InfoType] = None,
doc: Optional[str] = None,
**__kw: Any,
default_factory: Union[_NoArg, Callable[[], _T]] = _NoArg.NO_ARG,
compare: Union[_NoArg, bool] = _NoArg.NO_ARG,
kw_only: Union[_NoArg, bool] = _NoArg.NO_ARG,
+ hash: Union[_NoArg, bool, None] = _NoArg.NO_ARG, # noqa: A002
info: Optional[_InfoType] = None,
doc: Optional[str] = None,
**__kw: Any,
:ref:`orm_declarative_native_dataclasses`, indicates if this field
should be marked as keyword-only when generating the ``__init__()``.
+ :param hash: Specific to
+ :ref:`orm_declarative_native_dataclasses`, controls if this field
+ is included when generating the ``__hash__()`` method for the mapped
+ class.
+
+ .. versionadded:: 2.0.36
"""
if __kw:
raise _no_kw()
_class_or_attr,
*attrs,
attribute_options=_AttributeOptions(
- init, repr, default, default_factory, compare, kw_only
+ init, repr, default, default_factory, compare, kw_only, hash
),
group=group,
deferred=deferred,
default_factory: Union[_NoArg, Callable[[], _T]] = _NoArg.NO_ARG,
compare: Union[_NoArg, bool] = _NoArg.NO_ARG,
kw_only: Union[_NoArg, bool] = _NoArg.NO_ARG,
+ hash: Union[_NoArg, bool, None] = _NoArg.NO_ARG, # noqa: A002
lazy: _LazyLoadArgumentType = "select",
passive_deletes: Union[Literal["all"], bool] = False,
passive_updates: bool = True,
:ref:`orm_declarative_native_dataclasses`, indicates if this field
should be marked as keyword-only when generating the ``__init__()``.
+ :param hash: Specific to
+ :ref:`orm_declarative_native_dataclasses`, controls if this field
+ is included when generating the ``__hash__()`` method for the mapped
+ class.
+ .. versionadded:: 2.0.36
"""
return _RelationshipDeclared(
cascade=cascade,
viewonly=viewonly,
attribute_options=_AttributeOptions(
- init, repr, default, default_factory, compare, kw_only
+ init, repr, default, default_factory, compare, kw_only, hash
),
lazy=lazy,
passive_deletes=passive_deletes,
default_factory: Union[_NoArg, Callable[[], _T]] = _NoArg.NO_ARG,
compare: Union[_NoArg, bool] = _NoArg.NO_ARG,
kw_only: Union[_NoArg, bool] = _NoArg.NO_ARG,
+ hash: Union[_NoArg, bool, None] = _NoArg.NO_ARG, # noqa: A002
info: Optional[_InfoType] = None,
doc: Optional[str] = None,
) -> Synonym[Any]:
descriptor=descriptor,
comparator_factory=comparator_factory,
attribute_options=_AttributeOptions(
- init, repr, default, default_factory, compare, kw_only
+ init, repr, default, default_factory, compare, kw_only, hash
),
doc=doc,
info=info,
default_factory: Union[_NoArg, Callable[[], _T]] = _NoArg.NO_ARG,
compare: Union[_NoArg, bool] = _NoArg.NO_ARG,
kw_only: Union[_NoArg, bool] = _NoArg.NO_ARG,
+ hash: Union[_NoArg, bool, None] = _NoArg.NO_ARG, # noqa: A002
active_history: bool = False,
expire_on_flush: bool = True,
info: Optional[_InfoType] = None,
column,
*additional_columns,
attribute_options=_AttributeOptions(
- init, repr, default, default_factory, compare, kw_only
+ init, repr, default, default_factory, compare, kw_only, hash
),
group=group,
deferred=True,
_NoArg.NO_ARG,
compare,
_NoArg.NO_ARG,
+ _NoArg.NO_ARG,
),
expire_on_flush=expire_on_flush,
info=info,