File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,7 @@ Metaclass mixins (SQLAlchemy 1.x)
36
36
---------------------------------
37
37
38
38
If your code uses the SQLAlchemy 1.x API (the default for code that doesn't specify a ``model_class ``),
39
- then these mixins are automatically applied to the ``Model `` class. They can also be used
40
- directly to create custom metaclasses. See :doc: `customizing ` for more information.
39
+ then these mixins are automatically applied to the ``Model `` class.
41
40
42
41
.. autoclass :: DefaultMeta
43
42
@@ -46,18 +45,6 @@ directly to create custom metaclasses. See :doc:`customizing` for more informati
46
45
.. autoclass :: NameMetaMixin
47
46
48
47
49
- Base class mixins (SQLAlchemy 2.x)
50
- ----------------------------------
51
-
52
- If your code uses the SQLAlchemy 2.x API by passing a subclass of ``DeclarativeBase ``
53
- or ``DeclarativeBaseNoMeta `` as the ``model_class ``, then the following classes
54
- are automatically added as additional base classes.
55
-
56
- .. autoclass :: BindMixin
57
-
58
- .. autoclass :: NameMixin
59
-
60
-
61
48
Session
62
49
-------
63
50
Original file line number Diff line number Diff line change @@ -300,8 +300,11 @@ def should_set_tablename(cls: type) -> bool:
300
300
base is cls
301
301
or base .__dict__ .get ("__abstract__" , False )
302
302
or not (
303
+ # SQLAlchemy 1.x
303
304
isinstance (base , sa_orm .DeclarativeMeta )
305
+ # 2.x: DeclarativeBas uses this as metaclass
304
306
or isinstance (base , sa_orm .decl_api .DeclarativeAttributeIntercept )
307
+ # 2.x: DeclarativeBaseNoMeta doesn't use a metaclass
305
308
or issubclass (base , sa_orm .DeclarativeBaseNoMeta )
306
309
)
307
310
)
You can’t perform that action at this time.
0 commit comments