]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added col with no name example
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 11 Aug 2008 18:00:10 +0000 (18:00 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 11 Aug 2008 18:00:10 +0000 (18:00 +0000)
doc/build/content/plugins.txt

index be769113d0e342b18f634530a228a38b57b77d11..80e6c9fbb34e3d9e2222dd4cc011bbf93f59a983 100644 (file)
@@ -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: