From 2605e0cc2ad089d4f25c00a5f2c4d99ffbfa4567 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 16 Feb 2013 22:57:05 +0200 Subject: grammar fixes --- docs/narr/project.rst | 4 ++-- docs/narr/router.rst | 2 +- docs/narr/urldispatch.rst | 8 ++++---- docs/narr/viewconfig.rst | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/narr/project.rst b/docs/narr/project.rst index 5a8ea0ecf..184d36512 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -829,7 +829,7 @@ also informs Python that the directory which contains it is a *package*. #. Line 1 imports the :term:`Configurator` class from :mod:`pyramid.config` that we use later. -#. Lines 4-11 define a function named ``main`` that returns a :app:`Pyramid` +#. Lines 4-11 defines a function named ``main`` that returns a :app:`Pyramid` WSGI application. This function is meant to be called by the :term:`PasteDeploy` framework as a result of running ``pserve``. @@ -865,7 +865,7 @@ and which returns a :term:`response`. :language: python :linenos: -Lines 4-6 define and register a :term:`view callable` named ``my_view``. The +Lines 4-6 defines and registers a :term:`view callable` named ``my_view``. The function named ``my_view`` is decorated with a ``view_config`` decorator (which is processed by the ``config.scan()`` line in our ``__init__.py``). The view_config decorator asserts that this view be found when a diff --git a/docs/narr/router.rst b/docs/narr/router.rst index b78362066..ac3deefdc 100644 --- a/docs/narr/router.rst +++ b/docs/narr/router.rst @@ -46,7 +46,7 @@ request enters a :app:`Pyramid` application through to the point that :class:`~pyramid.interfaces.IRoute` object representing the route which matched. The root object associated with the route found is also generated: if the :term:`route configuration` which matched has an - associated a ``factory`` argument, this factory is used to generate the + associated ``factory`` argument, this factory is used to generate the root object, otherwise a default :term:`root factory` is used. #. If a route match was *not* found, and a ``root_factory`` argument was diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index 749a2d49a..34543c4bb 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -16,12 +16,12 @@ receives the :term:`request` and returns a :term:`response` object. High-Level Operational Overview ------------------------------- -If route configuration is present in an application, the :app:`Pyramid` +If a route configuration is present in an application, the :app:`Pyramid` :term:`Router` checks every incoming request against an ordered set of URL matching patterns present in a *route map*. If any route pattern matches the information in the :term:`request`, -:app:`Pyramid` will invoke :term:`view lookup` to find a matching view. +:app:`Pyramid` will invoke a :term:`view lookup` to find a matching view. If no route pattern in the route map matches the information in the :term:`request` provided in your application, :app:`Pyramid` will fail over @@ -71,7 +71,7 @@ invoked when the associated route pattern matches during a request. More commonly, you will not use any ``add_view`` statements in your project's "setup" code, instead only using ``add_route`` statements using a -:term:`scan` for to associate view callables with routes. For example, if +:term:`scan` to associate view callables with routes. For example, if this is a portion of your project's ``__init__.py``: .. code-block:: python @@ -83,7 +83,7 @@ this is a portion of your project's ``__init__.py``: Note that we don't call :meth:`~pyramid.config.Configurator.add_view` in this setup code. However, the above :term:`scan` execution -``config.scan('mypackage')`` will pick up all :term:`configuration +``config.scan('mypackage')`` will pick up each :term:`configuration decoration`, including any objects decorated with the :class:`pyramid.view.view_config` decorator in the ``mypackage`` Python package. For example, if you have a ``views.py`` in your package, a scan will diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst index e7c79b09b..63f9d1db5 100644 --- a/docs/narr/viewconfig.rst +++ b/docs/narr/viewconfig.rst @@ -62,9 +62,9 @@ particular view callable. :term:`View predicate` attributes are an important part of view configuration that enables the :term:`view lookup` subsystem to find and invoke the -appropriate view. The greater number of predicate attributes possessed by a +appropriate view. The greater the number of predicate attributes possessed by a view's configuration, the more specific the circumstances need to be before -the registered view callable will be invoked. The fewer number of predicates +the registered view callable will be invoked. The fewer the number of predicates which are supplied to a particular view configuration, the more likely it is that the associated view callable will be invoked. A view with five predicates will always be found and evaluated before a view with two, for -- cgit v1.2.3 From 02e6877a79fe7874af5103d9e6c886d67a09eb7f Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 6 Mar 2013 00:09:54 +0200 Subject: address issues raised by Tres Seaver at #884 --- docs/narr/project.rst | 4 ++-- docs/narr/urldispatch.rst | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/narr/project.rst b/docs/narr/project.rst index 184d36512..5a8ea0ecf 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -829,7 +829,7 @@ also informs Python that the directory which contains it is a *package*. #. Line 1 imports the :term:`Configurator` class from :mod:`pyramid.config` that we use later. -#. Lines 4-11 defines a function named ``main`` that returns a :app:`Pyramid` +#. Lines 4-11 define a function named ``main`` that returns a :app:`Pyramid` WSGI application. This function is meant to be called by the :term:`PasteDeploy` framework as a result of running ``pserve``. @@ -865,7 +865,7 @@ and which returns a :term:`response`. :language: python :linenos: -Lines 4-6 defines and registers a :term:`view callable` named ``my_view``. The +Lines 4-6 define and register a :term:`view callable` named ``my_view``. The function named ``my_view`` is decorated with a ``view_config`` decorator (which is processed by the ``config.scan()`` line in our ``__init__.py``). The view_config decorator asserts that this view be found when a diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index 34543c4bb..e58d98416 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -16,12 +16,13 @@ receives the :term:`request` and returns a :term:`response` object. High-Level Operational Overview ------------------------------- -If a route configuration is present in an application, the :app:`Pyramid` +If any route configuration is present in an application, the :app:`Pyramid` :term:`Router` checks every incoming request against an ordered set of URL matching patterns present in a *route map*. If any route pattern matches the information in the :term:`request`, -:app:`Pyramid` will invoke a :term:`view lookup` to find a matching view. +:app:`Pyramid` will invoke the :term:`view lookup` process to find a +matching view. If no route pattern in the route map matches the information in the :term:`request` provided in your application, :app:`Pyramid` will fail over -- cgit v1.2.3 From e81e76ae9e0fd1c45ddb61a873d67cd6e2d9f643 Mon Sep 17 00:00:00 2001 From: Georges Dubus Date: Thu, 14 Mar 2013 10:39:05 +0100 Subject: Added an options argument to pyramid.paste.get_appsettings, just like get_app, that can be used to get the settings when interpolation is used in the config file. --- docs/api/paster.rst | 2 +- pyramid/paster.py | 14 +++++++------- pyramid/tests/test_paster.py | 16 ++++++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/api/paster.rst b/docs/api/paster.rst index bde128e05..edc3738fc 100644 --- a/docs/api/paster.rst +++ b/docs/api/paster.rst @@ -9,6 +9,6 @@ .. autofunction:: get_app(config_uri, name=None, options=None) - .. autofunction:: get_appsettings(config_uri, name=None) + .. autofunction:: get_appsettings(config_uri, name=None, options=None) .. autofunction:: setup_logging(config_uri) diff --git a/pyramid/paster.py b/pyramid/paster.py index ce07d1fe0..edc0d406f 100644 --- a/pyramid/paster.py +++ b/pyramid/paster.py @@ -23,26 +23,26 @@ def get_app(config_uri, name=None, options=None, loadapp=loadapp): path, section = _getpathsec(config_uri, name) config_name = 'config:%s' % path here_dir = os.getcwd() - if options: - kw = {'global_conf': options} - else: - kw = {} - app = loadapp(config_name, name=section, relative_to=here_dir, **kw) + app = loadapp(config_name, name=section, relative_to=here_dir, global_conf=options) return app -def get_appsettings(config_uri, name=None, appconfig=appconfig): +def get_appsettings(config_uri, name=None, options=None, appconfig=appconfig): """ Return a dictionary representing the key/value pairs in an ``app`` section within the file represented by ``config_uri``. + ``options``, if passed, should be a dictionary used as variable assignments + like ``{'http_port': 8080}``. This is useful if e.g. ``%(http_port)s`` is + used in the config file. + If the ``name`` is None, this will attempt to parse the name from the ``config_uri`` string expecting the format ``inifile#name``. If no name is found, the name will default to "main".""" path, section = _getpathsec(config_uri, name) config_name = 'config:%s' % path here_dir = os.getcwd() - return appconfig(config_name, name=section, relative_to=here_dir) + return appconfig(config_name, name=section, relative_to=here_dir, global_conf=options) def setup_logging(config_uri, fileConfig=fileConfig, configparser=configparser): diff --git a/pyramid/tests/test_paster.py b/pyramid/tests/test_paster.py index b72e0e6b6..7c9243e9d 100644 --- a/pyramid/tests/test_paster.py +++ b/pyramid/tests/test_paster.py @@ -56,14 +56,15 @@ class Test_get_app(unittest.TestCase): self.assertEqual(result, app) class Test_get_appsettings(unittest.TestCase): - def _callFUT(self, config_file, section_name, appconfig): + def _callFUT(self, config_file, section_name, options=None, appconfig=None): from pyramid.paster import get_appsettings - return get_appsettings(config_file, section_name, appconfig) + return get_appsettings(config_file, section_name, options, appconfig) def test_it(self): values = {'a':1} appconfig = DummyLoadWSGI(values) - result = self._callFUT('/foo/bar/myapp.ini', 'myapp', appconfig) + result = self._callFUT('/foo/bar/myapp.ini', 'myapp', + appconfig=appconfig) self.assertEqual(appconfig.config_name, 'config:/foo/bar/myapp.ini') self.assertEqual(appconfig.section_name, 'myapp') self.assertEqual(appconfig.relative_to, os.getcwd()) @@ -72,7 +73,8 @@ class Test_get_appsettings(unittest.TestCase): def test_it_with_hash(self): values = {'a':1} appconfig = DummyLoadWSGI(values) - result = self._callFUT('/foo/bar/myapp.ini#myapp', None, appconfig) + result = self._callFUT('/foo/bar/myapp.ini#myapp', None, + appconfig=appconfig) self.assertEqual(appconfig.config_name, 'config:/foo/bar/myapp.ini') self.assertEqual(appconfig.section_name, 'myapp') self.assertEqual(appconfig.relative_to, os.getcwd()) @@ -81,7 +83,8 @@ class Test_get_appsettings(unittest.TestCase): def test_it_with_hash_and_name_override(self): values = {'a':1} appconfig = DummyLoadWSGI(values) - result = self._callFUT('/foo/bar/myapp.ini#myapp', 'yourapp', appconfig) + result = self._callFUT('/foo/bar/myapp.ini#myapp', 'yourapp', + appconfig=appconfig) self.assertEqual(appconfig.config_name, 'config:/foo/bar/myapp.ini') self.assertEqual(appconfig.section_name, 'yourapp') self.assertEqual(appconfig.relative_to, os.getcwd()) @@ -181,6 +184,3 @@ class DummyConfigParser(object): class DummyConfigParserModule(object): ConfigParser = DummyConfigParser - - - -- cgit v1.2.3 From 96957012b93bbe8798c085591c3e01da10312add Mon Sep 17 00:00:00 2001 From: Georges Dubus Date: Thu, 14 Mar 2013 10:51:27 +0100 Subject: Added support for config file variables to the scaffold script initializedb. --- pyramid/scaffolds/alchemy/+package+/scripts/initializedb.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyramid/scaffolds/alchemy/+package+/scripts/initializedb.py b/pyramid/scaffolds/alchemy/+package+/scripts/initializedb.py index 66feb3008..7dfdece15 100644 --- a/pyramid/scaffolds/alchemy/+package+/scripts/initializedb.py +++ b/pyramid/scaffolds/alchemy/+package+/scripts/initializedb.py @@ -9,6 +9,8 @@ from pyramid.paster import ( setup_logging, ) +from pyramid.scripts.common import parse_vars + from ..models import ( DBSession, MyModel, @@ -18,17 +20,18 @@ from ..models import ( def usage(argv): cmd = os.path.basename(argv[0]) - print('usage: %s \n' + print('usage: %s [var=value]\n' '(example: "%s development.ini")' % (cmd, cmd)) sys.exit(1) def main(argv=sys.argv): - if len(argv) != 2: + if len(argv) < 2: usage(argv) config_uri = argv[1] + options = parse_vars(argv[2:]) setup_logging(config_uri) - settings = get_appsettings(config_uri) + settings = get_appsettings(config_uri, options=options) engine = engine_from_config(settings, 'sqlalchemy.') DBSession.configure(bind=engine) Base.metadata.create_all(engine) -- cgit v1.2.3 From bc063da0e248c9b6df6af29ec1f5217accd703d2 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 17 Mar 2013 13:09:59 +0200 Subject: no need to re-install This will continue working fine. --- docs/tutorials/wiki2/definingmodels.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst index bd1cb00d7..99f7969bc 100644 --- a/docs/tutorials/wiki2/definingmodels.rst +++ b/docs/tutorials/wiki2/definingmodels.rst @@ -77,8 +77,6 @@ following: Installing the Project and re-initializing the Database ------------------------------------------------------- -Redo the steps in :ref:`installing_project_in_dev_mode`. - Because our model has changed, in order to reinitialize the database, we need to rerun the ``initialize_tutorial_db`` command to pick up the changes you've made to both the models.py file and to the initializedb.py file. -- cgit v1.2.3 From 9435d665b797e7a61410cf608d1f1bff4695c2f8 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 21 Mar 2013 01:54:00 +0200 Subject: revert to a better paragraph --- docs/tutorials/wiki2/installation.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst index 4b09f6eb7..bb22371ab 100644 --- a/docs/tutorials/wiki2/installation.rst +++ b/docs/tutorials/wiki2/installation.rst @@ -70,7 +70,9 @@ Install Pyramid Into the Virtual Python Environment SQLite3 ------- -If you used a package manager to install your Python, or if you compiled your Python from source, then you must install SQLite3 and its development packages. If you downloaded your Python from python.org On a Debian system, this would be: +Install SQLite3 and its development packages if you don't already +have them installed. Usually this is via your system's package +manager. On a Debian system, this would be: .. code-block:: text -- cgit v1.2.3 From a4010d1b2d3e7c266c2369bb166cf2d7cfafc783 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 21 Mar 2013 02:03:20 +0200 Subject: slightly re-organise --- docs/tutorials/wiki2/installation.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst index 4b09f6eb7..f55c047ba 100644 --- a/docs/tutorials/wiki2/installation.rst +++ b/docs/tutorials/wiki2/installation.rst @@ -76,16 +76,17 @@ If you used a package manager to install your Python, or if you compiled your Py $ sudo apt-get install libsqlite3-dev -#. Switch to the ``pyramidtut`` directory: +Entering the virtualenv +----------------------- + +Do not forget to switch to the ``pyramidtut`` directory. +In order to do so, run this command if you are on Unix: .. code-block:: text $ cd pyramidtut -Windows Requirements --------------------- - -#. Switch to the ``pyramidtut`` directory: +And run this if you are on Windows: .. code-block:: text -- cgit v1.2.3 From 924888ed7c8a953d427517bbd6bc3ae4dcd2e27b Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 20 Mar 2013 22:53:00 -0500 Subject: add some tests for options within ini files --- pyramid/paster.py | 12 ++++++++++-- pyramid/tests/fixtures/dummy.ini | 4 ++++ pyramid/tests/test_paster.py | 32 ++++++++++++++++++++++++++------ 3 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 pyramid/tests/fixtures/dummy.ini diff --git a/pyramid/paster.py b/pyramid/paster.py index edc0d406f..967543849 100644 --- a/pyramid/paster.py +++ b/pyramid/paster.py @@ -24,7 +24,11 @@ def get_app(config_uri, name=None, options=None, loadapp=loadapp): config_name = 'config:%s' % path here_dir = os.getcwd() - app = loadapp(config_name, name=section, relative_to=here_dir, global_conf=options) + app = loadapp( + config_name, + name=section, + relative_to=here_dir, + global_conf=options) return app @@ -42,7 +46,11 @@ def get_appsettings(config_uri, name=None, options=None, appconfig=appconfig): path, section = _getpathsec(config_uri, name) config_name = 'config:%s' % path here_dir = os.getcwd() - return appconfig(config_name, name=section, relative_to=here_dir, global_conf=options) + return appconfig( + config_name, + name=section, + relative_to=here_dir, + global_conf=options) def setup_logging(config_uri, fileConfig=fileConfig, configparser=configparser): diff --git a/pyramid/tests/fixtures/dummy.ini b/pyramid/tests/fixtures/dummy.ini new file mode 100644 index 000000000..bc2281168 --- /dev/null +++ b/pyramid/tests/fixtures/dummy.ini @@ -0,0 +1,4 @@ +[app:myapp] +use = call:pyramid.tests.test_paster:make_dummyapp + +foo = %(bar)s diff --git a/pyramid/tests/test_paster.py b/pyramid/tests/test_paster.py index 7c9243e9d..5e341172c 100644 --- a/pyramid/tests/test_paster.py +++ b/pyramid/tests/test_paster.py @@ -1,12 +1,12 @@ import os import unittest +here = os.path.dirname(__file__) + class Test_get_app(unittest.TestCase): - def _callFUT(self, config_file, section_name, options=None, loadapp=None): + def _callFUT(self, config_file, section_name, **kw): from pyramid.paster import get_app - return get_app( - config_file, section_name, options=options, loadapp=loadapp - ) + return get_app(config_file, section_name, **kw) def test_it(self): app = DummyApp() @@ -55,10 +55,17 @@ class Test_get_app(unittest.TestCase): self.assertEqual(loadapp.kw, {'global_conf':options}) self.assertEqual(result, app) + def test_it_with_dummyapp_requiring_options(self): + options = {'bar': 'baz'} + app = self._callFUT( + os.path.join(here, 'fixtures', 'dummy.ini'), + 'myapp', options=options) + self.assertEqual(app.settings['foo'], 'baz') + class Test_get_appsettings(unittest.TestCase): - def _callFUT(self, config_file, section_name, options=None, appconfig=None): + def _callFUT(self, config_file, section_name, **kw): from pyramid.paster import get_appsettings - return get_appsettings(config_file, section_name, options, appconfig) + return get_appsettings(config_file, section_name, **kw) def test_it(self): values = {'a':1} @@ -90,6 +97,13 @@ class Test_get_appsettings(unittest.TestCase): self.assertEqual(appconfig.relative_to, os.getcwd()) self.assertEqual(result, values) + def test_it_with_dummyapp_requiring_options(self): + options = {'bar': 'baz'} + result = self._callFUT( + os.path.join(here, 'fixtures', 'dummy.ini'), + 'myapp', options=options) + self.assertEqual(result['foo'], 'baz') + class Test_setup_logging(unittest.TestCase): def _callFUT(self, config_file): from pyramid.paster import setup_logging @@ -168,6 +182,12 @@ class DummyApp: def __init__(self): self.registry = dummy_registry +def make_dummyapp(global_conf, **settings): + app = DummyApp() + app.settings = settings + app.global_conf = global_conf + return app + class DummyRequest: application_url = 'http://example.com:5432' script_name = '' -- cgit v1.2.3 From 38844f75e4a2cd85315f1d570b5b63d00ec1b0b4 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 20 Mar 2013 23:12:32 -0500 Subject: update CHANGES.txt --- CHANGES.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 6ff54884a..2366522df 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -21,6 +21,14 @@ Features define how to properly handle IPv6. See https://github.com/Pylons/pyramid/issues/831. +- Make it possible to use variable arguments via + ``pyramid.paster.get_appsettings``. This also allowed the generated + ``initialize_db`` script from the ``alchemy`` scaffold to grow support + for options in the form ``a=1 b=2`` so you can fill in + values in a parameterized ``.ini`` file, e.g. + ``initialize_myapp_db etc/development.ini a=1 b=2``. + See https://github.com/Pylons/pyramid/pull/911 + Bug Fixes --------- -- cgit v1.2.3 From 468837972b0185695073f530d0fb976637c90285 Mon Sep 17 00:00:00 2001 From: Georges Dubus Date: Thu, 21 Mar 2013 08:28:50 +0100 Subject: Update CONTRIBUTORS.txt --- CONTRIBUTORS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 971c172f8..83f1ee2d5 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -192,3 +192,5 @@ Contributors - Robert Jackiewicz, 2012/11/12 - John Anderson, 2012/11/14 + +- Georges Dubus, 2013/03/21 -- cgit v1.2.3 From f1c29f104a14dea0be612ca0aa8ecd49e165fafa Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 21 Mar 2013 18:24:31 +0200 Subject: add hyperlinks for SQLAlchemy --- docs/conf.py | 1 + docs/tutorials/wiki2/basiclayout.rst | 6 +++--- docs/tutorials/wiki2/definingmodels.rst | 9 +++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 8d22d4d42..b763267dd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,6 +55,7 @@ extensions = [ # Looks for objects in external projects intersphinx_mapping = { + 'sqla': ('http://docs.sqlalchemy.org/en/rel_0_8/', None), 'who': ('http://docs.repoze.org/who/2.0', None), 'python': ('http://docs.python.org', None), 'python3': ('http://docs.python.org/3', None), diff --git a/docs/tutorials/wiki2/basiclayout.rst b/docs/tutorials/wiki2/basiclayout.rst index 86fe97956..eb2445864 100644 --- a/docs/tutorials/wiki2/basiclayout.rst +++ b/docs/tutorials/wiki2/basiclayout.rst @@ -43,9 +43,9 @@ above is executed. It accepts some settings and returns a :term:`WSGI` application. (See :ref:`startup_chapter` for more about ``pserve``.) The main function first creates a :term:`SQLAlchemy` database engine using -``engine_from_config`` from the ``sqlalchemy.`` prefixed settings in the -``development.ini`` file's ``[app:main]`` section. This will be a URI -(something like ``sqlite://``): +:func:`sqlalchemy.engine_from_config` from the ``sqlalchemy.`` prefixed +settings in the ``development.ini`` file's ``[app:main]`` section. +This will be a URI (something like ``sqlite://``): .. literalinclude:: src/basiclayout/tutorial/__init__.py :lines: 13 diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst index bd1cb00d7..d55da02cd 100644 --- a/docs/tutorials/wiki2/definingmodels.rst +++ b/docs/tutorials/wiki2/definingmodels.rst @@ -34,7 +34,7 @@ sample and we're not going to use it. Then, we added a ``Page`` class. Because this is a SQLAlchemy application, this class inherits from an instance of -:class:`sqlalchemy.ext.declarative.declarative_base`. +:func:`sqlalchemy.ext.declarative.declarative_base`. .. literalinclude:: src/models/tutorial/models.py :pyobject: Page @@ -45,9 +45,10 @@ As you can see, our ``Page`` class has a class level attribute ``__tablename__`` which equals the string ``'pages'``. This means that SQLAlchemy will store our wiki data in a SQL table named ``pages``. Our ``Page`` class will also have class-level attributes named ``id``, ``name`` and -``data`` (all instances of :class:`sqlalchemy.Column`). These will map to -columns in the ``pages`` table. The ``id`` attribute will be the primary key -in the table. The ``name`` attribute will be a text attribute, each value of +``data`` (all instances of :class:`sqlalchemy.schema.Column`). +These will map to columns in the ``pages`` table. +The ``id`` attribute will be the primary key in the table. +The ``name`` attribute will be a text attribute, each value of which needs to be unique within the column. The ``data`` attribute is a text attribute that will hold the body of each page. -- cgit v1.2.3 From 39b8a29a48d716b3381596fe71cddf6c59393518 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 21 Mar 2013 18:37:28 +0200 Subject: use version-agnostic link, to avoid maintenance --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index b763267dd..d1a882389 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,7 +55,7 @@ extensions = [ # Looks for objects in external projects intersphinx_mapping = { - 'sqla': ('http://docs.sqlalchemy.org/en/rel_0_8/', None), + 'sqla': ('http://docs.sqlalchemy.org/en/latest', None), 'who': ('http://docs.repoze.org/who/2.0', None), 'python': ('http://docs.python.org', None), 'python3': ('http://docs.python.org/3', None), -- cgit v1.2.3 From 2a65f2086ce5b0c2f029fbc0ea165a65cd601ec3 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 21 Mar 2013 18:52:07 +0200 Subject: four spaces is standard --- docs/conf.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index d1a882389..89eb998e7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,14 +55,14 @@ extensions = [ # Looks for objects in external projects intersphinx_mapping = { - 'sqla': ('http://docs.sqlalchemy.org/en/latest', None), - 'who': ('http://docs.repoze.org/who/2.0', None), - 'python': ('http://docs.python.org', None), - 'python3': ('http://docs.python.org/3', None), - 'tstring': + 'sqla': ('http://docs.sqlalchemy.org/en/latest', None), + 'who': ('http://docs.repoze.org/who/2.0', None), + 'python': ('http://docs.python.org', None), + 'python3': ('http://docs.python.org/3', None), + 'tstring': ('http://docs.pylonsproject.org/projects/translationstring/en/latest', None), - 'venusian': + 'venusian': ('http://docs.pylonsproject.org/projects/venusian/en/latest', None), } -- cgit v1.2.3 From 09bca9c5ed0e66699762d66b09be899e86967899 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Thu, 21 Mar 2013 12:40:02 -0500 Subject: update repoze.who to latest symlink --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 89eb998e7..eff6db488 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -56,7 +56,7 @@ extensions = [ # Looks for objects in external projects intersphinx_mapping = { 'sqla': ('http://docs.sqlalchemy.org/en/latest', None), - 'who': ('http://docs.repoze.org/who/2.0', None), + 'who': ('http://docs.repoze.org/who/latest', None), 'python': ('http://docs.python.org', None), 'python3': ('http://docs.python.org/3', None), 'tstring': -- cgit v1.2.3