From cd91da9732fc14d1566e7df562c18ebbc54a2d6f Mon Sep 17 00:00:00 2001 From: Jack Michaud Date: Tue, 7 Jun 2022 11:38:04 -0700 Subject: [PATCH] docs(cookbook): add note on including info object on declarative tables (#1051) --- docs/build/cookbook.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/build/cookbook.rst b/docs/build/cookbook.rst index 23202ea9..e2b92333 100644 --- a/docs/build/cookbook.rst +++ b/docs/build/cookbook.rst @@ -1150,6 +1150,12 @@ causes Alembic to treat them as tables in need of creation and to generate spuri my_view = Table('my_view', metadata, autoload=True, info=dict(is_view=True)) # Flag this as a view +Or, if you use declarative tables:: + + class MyView(Base): + __tablename__ = 'my_view' + __table_args__ = {'info': {'is_view': True}} # Flag this as a view + Then define ``include_object`` as:: def include_object(object, name, type_, reflected, compare_to): -- 2.47.2