You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.8KB

  1. # ext/declarative/__init__.py
  2. # Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
  3. # <see AUTHORS file>
  4. #
  5. # This module is part of SQLAlchemy and is released under
  6. # the MIT License: http://www.opensource.org/licenses/mit-license.php
  7. from .extensions import AbstractConcreteBase
  8. from .extensions import ConcreteBase
  9. from .extensions import DeferredReflection
  10. from .extensions import instrument_declarative
  11. from ... import util
  12. from ...orm.decl_api import as_declarative as _as_declarative
  13. from ...orm.decl_api import declarative_base as _declarative_base
  14. from ...orm.decl_api import DeclarativeMeta
  15. from ...orm.decl_api import declared_attr
  16. from ...orm.decl_api import has_inherited_table as _has_inherited_table
  17. from ...orm.decl_api import synonym_for as _synonym_for
  18. @util.moved_20(
  19. "The ``declarative_base()`` function is now available as "
  20. ":func:`sqlalchemy.orm.declarative_base`."
  21. )
  22. def declarative_base(*arg, **kw):
  23. return _declarative_base(*arg, **kw)
  24. @util.moved_20(
  25. "The ``as_declarative()`` function is now available as "
  26. ":func:`sqlalchemy.orm.as_declarative`"
  27. )
  28. def as_declarative(*arg, **kw):
  29. return _as_declarative(*arg, **kw)
  30. @util.moved_20(
  31. "The ``has_inherited_table()`` function is now available as "
  32. ":func:`sqlalchemy.orm.has_inherited_table`."
  33. )
  34. def has_inherited_table(*arg, **kw):
  35. return _has_inherited_table(*arg, **kw)
  36. @util.moved_20(
  37. "The ``synonym_for()`` function is now available as "
  38. ":func:`sqlalchemy.orm.synonym_for`"
  39. )
  40. def synonym_for(*arg, **kw):
  41. return _synonym_for(*arg, **kw)
  42. __all__ = [
  43. "declarative_base",
  44. "synonym_for",
  45. "has_inherited_table",
  46. "instrument_declarative",
  47. "declared_attr",
  48. "as_declarative",
  49. "ConcreteBase",
  50. "AbstractConcreteBase",
  51. "DeclarativeMeta",
  52. "DeferredReflection",
  53. ]