From bf43d45ceabaed98953ed53f5dbaa8c202c1938b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 11 Aug 2008 18:00:10 +0000 Subject: [PATCH] added col with no name example --- doc/build/content/plugins.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/build/content/plugins.txt b/doc/build/content/plugins.txt index be769113d0..80e6c9fbb3 100644 --- a/doc/build/content/plugins.txt +++ b/doc/build/content/plugins.txt @@ -30,6 +30,15 @@ Above, the `declarative_base` callable produces a new base class from which all completed, a new `Table` and `mapper()` have been generated, accessible via the `__table__` and `__mapper__` attributes on the `SomeClass` class. +You may omit the names from the Column definitions. Declarative will fill +them in for you: + + {python} + class SomeClass(Base): + __tablename__ = 'some_table' + id = Column(Integer, primary_key=True) + name = Column(String(50)) + Attributes may be added to the class after its construction, and they will be added to the underlying `Table` and `mapper()` definitions as appropriate: -- 2.47.3