Commits

Anonymous committed cb28c1a Merge

Merge chrism's code.

  • Participants
  • Parent commits 7efb986, bb9334b

Comments (0)

Files changed (4)

+development
+-----------
+- Delete unneeded development code in static.py.
+
 1.0rc1  (2010-01-26)
 --------------------
 

File docs/usage.rst

 Usage and API
 %%%%%%%%%%%%%
 
+The ``pyramid_sqla`` package contains three things: a SQLAlchemy scoped
+session, a place for registering SQLAlchemy engines by name, and a declarative
+base object. You can use all of these together in your application, or just use
+some of them and ignore the others, as you prefer.
+
 Installation
 ============
 
 pyramid_sqla" or "easy_install pyramid_sqla". To check out the development
 repository: "hg clone http://bitbucket.org/sluggo/pyramid_sqla". 
 
-A wiki demo is in preparation but is not available yet.
-
 Usage
 =====
 

File pyramid_sqla/__init__.py

     Arguments:
 
     * ``settings``: A dict of application settings (e.g., as parsed from an INI
-      file), or a dict containing engine args. If this argument is passed, I
-      call ``sqlalchemy.engine_from_config(settings, prefix)``.
-
+      file). If this argument is passed, I call
+      ``sqlalchemy.engine_from_config(settings, prefix)``.
     * ``name``: The engine name. This is used to retrieve the engine later. The
       default name is "default".
 
       The default value is "sqlalchemy.", which tells SQLAlchemy to use the
       keys starting with "sqlalchemy." for this engine.
 
+     Note: SQLAlchemy does not allow ``prefix`` to be ``""``. If you have the
+     exact engine args in a dict without a prefix, pass them as keyword args. 
+
     * ``engine``: An existing SQLAlchemy engine. If you pass this you can't
       pass ``settings``, ``prefix``, or ``**engine_args``.
 

File pyramid_sqla/static.py

 
     def __call__(self, info, request):
         subpath = info["match"]["subpath"]
+        #log.debug("subpath is %r", subpath)
         if not subpath:
+            #log.debug("no subpath, returning false")
             return False
         parts = [self.subdir]
         parts.extend(subpath)
         resource_name = "/".join(parts)
+        #log.debug("package=%r, resource_name=%r", self.package, resource_name)
         return pkg_resources.resource_exists(self.package, resource_name)