]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
tpo
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Jul 2013 04:41:10 +0000 (00:41 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Jul 2013 04:41:21 +0000 (00:41 -0400)
lib/sqlalchemy/ext/declarative/api.py

index 9cbe322673b62f0667722ad05a7f6f49674f4f87..90076fdbb5b90471d33f7b8391c2d3413121fe26 100644 (file)
@@ -249,17 +249,17 @@ def as_declarative(**kw):
     sent to :func:`.declarative_base`, allowing the base class
     to be converted in-place to a "declarative" base::
 
-    from sqlalchemy.ext.declarative import as_declarative
+        from sqlalchemy.ext.declarative import as_declarative
 
-    @as_declarative()
-    class Base(object)
-        @declared_attr
-        def __tablename__(cls):
-            return cls.__name__.lower()
-        id = Column(Integer, primary_key=True)
+        @as_declarative()
+        class Base(object)
+            @declared_attr
+            def __tablename__(cls):
+                return cls.__name__.lower()
+            id = Column(Integer, primary_key=True)
 
-    class MyMappedClass(Base):
-        # ...
+        class MyMappedClass(Base):
+            # ...
 
     All keyword arguments passed to :func:`.as_declarative` are passed
     along to :func:`.declarative_base`.