From c5e93f9f87c6d98be8db51fc3711ea83c881899a Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 17 Nov 2018 06:30:45 -0800 Subject: Remove mention of py3 compat --- docs/tutorials/wiki/src/views/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/setup.py b/docs/tutorials/wiki/src/views/setup.py index a11ae6c8f..2d120224f 100644 --- a/docs/tutorials/wiki/src/views/setup.py +++ b/docs/tutorials/wiki/src/views/setup.py @@ -23,7 +23,7 @@ requires = [ ] tests_require = [ - 'WebTest >= 1.3.1', # py3 compat + 'WebTest >= 1.3.1', 'pytest>=3.7.4', 'pytest-cov', ] -- cgit v1.2.3 From 54fba396ce913c9731f920447d680f1480d8517e Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 18 Nov 2018 05:15:42 -0800 Subject: Unpin webtest and pytest --- docs/tutorials/wiki/src/views/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/setup.py b/docs/tutorials/wiki/src/views/setup.py index 2d120224f..3c19db7b9 100644 --- a/docs/tutorials/wiki/src/views/setup.py +++ b/docs/tutorials/wiki/src/views/setup.py @@ -23,8 +23,8 @@ requires = [ ] tests_require = [ - 'WebTest >= 1.3.1', - 'pytest>=3.7.4', + 'WebTest', + 'pytest', 'pytest-cov', ] -- cgit v1.2.3 From 5a2a68d508c3c433dcb6a8ed5824bd99a0b6d8d4 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 24 Nov 2018 04:18:14 -0800 Subject: Synch non-view and non-template src/views files --- docs/tutorials/wiki/src/views/MANIFEST.in | 2 +- docs/tutorials/wiki/src/views/pytest.ini | 2 +- docs/tutorials/wiki/src/views/setup.py | 4 ++-- docs/tutorials/wiki/src/views/tutorial/__init__.py | 8 ++++---- docs/tutorials/wiki/src/views/tutorial/models.py | 20 -------------------- .../wiki/src/views/tutorial/models/__init__.py | 20 ++++++++++++++++++++ docs/tutorials/wiki/src/views/tutorial/pshell.py | 1 + docs/tutorials/wiki/src/views/tutorial/routes.py | 2 ++ docs/tutorials/wiki/src/views/tutorial/tests.py | 3 ++- 9 files changed, 33 insertions(+), 29 deletions(-) delete mode 100644 docs/tutorials/wiki/src/views/tutorial/models.py create mode 100644 docs/tutorials/wiki/src/views/tutorial/models/__init__.py create mode 100644 docs/tutorials/wiki/src/views/tutorial/routes.py (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/MANIFEST.in b/docs/tutorials/wiki/src/views/MANIFEST.in index 81beba1b1..05cc195d9 100644 --- a/docs/tutorials/wiki/src/views/MANIFEST.in +++ b/docs/tutorials/wiki/src/views/MANIFEST.in @@ -1,2 +1,2 @@ include *.txt *.ini *.cfg *.rst -recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml +recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 diff --git a/docs/tutorials/wiki/src/views/pytest.ini b/docs/tutorials/wiki/src/views/pytest.ini index 8b76bc410..a3489cdf8 100644 --- a/docs/tutorials/wiki/src/views/pytest.ini +++ b/docs/tutorials/wiki/src/views/pytest.ini @@ -1,3 +1,3 @@ [pytest] testpaths = tutorial -python_files = *.py +python_files = test*.py diff --git a/docs/tutorials/wiki/src/views/setup.py b/docs/tutorials/wiki/src/views/setup.py index 3c19db7b9..6f3cae397 100644 --- a/docs/tutorials/wiki/src/views/setup.py +++ b/docs/tutorials/wiki/src/views/setup.py @@ -10,15 +10,15 @@ with open(os.path.join(here, 'CHANGES.txt')) as f: requires = [ 'plaster_pastedeploy', - 'pyramid >= 1.9a', + 'pyramid', 'pyramid_chameleon', 'pyramid_debugtoolbar', + 'waitress', 'pyramid_retry', 'pyramid_tm', 'pyramid_zodbconn', 'transaction', 'ZODB3', - 'waitress', 'docutils', ] diff --git a/docs/tutorials/wiki/src/views/tutorial/__init__.py b/docs/tutorials/wiki/src/views/tutorial/__init__.py index f2b3c9568..bd0c71f5b 100644 --- a/docs/tutorials/wiki/src/views/tutorial/__init__.py +++ b/docs/tutorials/wiki/src/views/tutorial/__init__.py @@ -11,13 +11,13 @@ def root_factory(request): def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ - settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' with Configurator(settings=settings) as config: - config.include('pyramid_chameleon') + settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' config.include('pyramid_tm') config.include('pyramid_retry') config.include('pyramid_zodbconn') config.set_root_factory(root_factory) - config.add_static_view('static', 'static', cache_max_age=3600) + config.include('pyramid_chameleon') + config.include('.routes') config.scan() - return config.make_wsgi_app() + return config.make_wsgi_app() diff --git a/docs/tutorials/wiki/src/views/tutorial/models.py b/docs/tutorials/wiki/src/views/tutorial/models.py deleted file mode 100644 index 7c6597afa..000000000 --- a/docs/tutorials/wiki/src/views/tutorial/models.py +++ /dev/null @@ -1,20 +0,0 @@ -from persistent import Persistent -from persistent.mapping import PersistentMapping - -class Wiki(PersistentMapping): - __name__ = None - __parent__ = None - -class Page(Persistent): - def __init__(self, data): - self.data = data - -def appmaker(zodb_root): - if 'app_root' not in zodb_root: - app_root = Wiki() - frontpage = Page('This is the front page') - app_root['FrontPage'] = frontpage - frontpage.__name__ = 'FrontPage' - frontpage.__parent__ = app_root - zodb_root['app_root'] = app_root - return zodb_root['app_root'] diff --git a/docs/tutorials/wiki/src/views/tutorial/models/__init__.py b/docs/tutorials/wiki/src/views/tutorial/models/__init__.py new file mode 100644 index 000000000..7c6597afa --- /dev/null +++ b/docs/tutorials/wiki/src/views/tutorial/models/__init__.py @@ -0,0 +1,20 @@ +from persistent import Persistent +from persistent.mapping import PersistentMapping + +class Wiki(PersistentMapping): + __name__ = None + __parent__ = None + +class Page(Persistent): + def __init__(self, data): + self.data = data + +def appmaker(zodb_root): + if 'app_root' not in zodb_root: + app_root = Wiki() + frontpage = Page('This is the front page') + app_root['FrontPage'] = frontpage + frontpage.__name__ = 'FrontPage' + frontpage.__parent__ = app_root + zodb_root['app_root'] = app_root + return zodb_root['app_root'] diff --git a/docs/tutorials/wiki/src/views/tutorial/pshell.py b/docs/tutorials/wiki/src/views/tutorial/pshell.py index 3d026291b..a7cfa6a27 100644 --- a/docs/tutorials/wiki/src/views/tutorial/pshell.py +++ b/docs/tutorials/wiki/src/views/tutorial/pshell.py @@ -1,5 +1,6 @@ from . import models + def setup(env): request = env['request'] diff --git a/docs/tutorials/wiki/src/views/tutorial/routes.py b/docs/tutorials/wiki/src/views/tutorial/routes.py new file mode 100644 index 000000000..3c0a37992 --- /dev/null +++ b/docs/tutorials/wiki/src/views/tutorial/routes.py @@ -0,0 +1,2 @@ +def includeme(config): + config.add_static_view('static', 'static', cache_max_age=3600) diff --git a/docs/tutorials/wiki/src/views/tutorial/tests.py b/docs/tutorials/wiki/src/views/tutorial/tests.py index ca7a47279..6279d9f66 100644 --- a/docs/tutorials/wiki/src/views/tutorial/tests.py +++ b/docs/tutorials/wiki/src/views/tutorial/tests.py @@ -11,7 +11,8 @@ class ViewTests(unittest.TestCase): testing.tearDown() def test_my_view(self): - from .views import my_view + from .views.default import my_view request = testing.DummyRequest() info = my_view(request) self.assertEqual(info['project'], 'myproj') + -- cgit v1.2.3 From dc97176989ab06d260f1561e89681b607c1b9fc9 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 24 Nov 2018 04:31:43 -0800 Subject: Clean up introduction to views, synch views files --- .../wiki/src/views/tutorial/views/__init__.py | 0 .../wiki/src/views/tutorial/views/default.py | 60 ++++++++++++++++++++++ .../wiki/src/views/tutorial/views/notfound.py | 7 +++ 3 files changed, 67 insertions(+) create mode 100644 docs/tutorials/wiki/src/views/tutorial/views/__init__.py create mode 100644 docs/tutorials/wiki/src/views/tutorial/views/default.py create mode 100644 docs/tutorials/wiki/src/views/tutorial/views/notfound.py (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/tutorial/views/__init__.py b/docs/tutorials/wiki/src/views/tutorial/views/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/docs/tutorials/wiki/src/views/tutorial/views/default.py b/docs/tutorials/wiki/src/views/tutorial/views/default.py new file mode 100644 index 000000000..dfc42c96a --- /dev/null +++ b/docs/tutorials/wiki/src/views/tutorial/views/default.py @@ -0,0 +1,60 @@ +from docutils.core import publish_parts +import re + +from pyramid.httpexceptions import HTTPFound +from pyramid.view import view_config + +from .models import Page + +# regular expression used to find WikiWords +wikiwords = re.compile(r"\b([A-Z]\w+[A-Z]+\w+)") + +@view_config(context='.models.Wiki') +def view_wiki(context, request): + return HTTPFound(location=request.resource_url(context, 'FrontPage')) + +@view_config(context='.models.Page', renderer='templates/view.pt') +def view_page(context, request): + wiki = context.__parent__ + + def check(match): + word = match.group(1) + if word in wiki: + page = wiki[word] + view_url = request.resource_url(page) + return '%s' % (view_url, word) + else: + add_url = request.application_url + '/add_page/' + word + return '%s' % (add_url, word) + + content = publish_parts(context.data, writer_name='html')['html_body'] + content = wikiwords.sub(check, content) + edit_url = request.resource_url(context, 'edit_page') + return dict(page=context, content=content, edit_url=edit_url) + +@view_config(name='add_page', context='.models.Wiki', + renderer='templates/edit.pt') +def add_page(context, request): + pagename = request.subpath[0] + if 'form.submitted' in request.params: + body = request.params['body'] + page = Page(body) + page.__name__ = pagename + page.__parent__ = context + context[pagename] = page + return HTTPFound(location=request.resource_url(page)) + save_url = request.resource_url(context, 'add_page', pagename) + page = Page('') + page.__name__ = pagename + page.__parent__ = context + return dict(page=page, save_url=save_url) + +@view_config(name='edit_page', context='.models.Page', + renderer='templates/edit.pt') +def edit_page(context, request): + if 'form.submitted' in request.params: + context.data = request.params['body'] + return HTTPFound(location=request.resource_url(context)) + + return dict(page=context, + save_url=request.resource_url(context, 'edit_page')) diff --git a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py new file mode 100644 index 000000000..728791d0a --- /dev/null +++ b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py @@ -0,0 +1,7 @@ +from pyramid.view import notfound_view_config + + +@notfound_view_config(renderer='../templates/404.pt') +def notfound_view(request): + request.response.status = 404 + return {} -- cgit v1.2.3 From 9161c6a4a2e5b96043a4b4f9171a6cd2fc7ec337 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 03:35:54 -0800 Subject: Fix imports, contexts, paths to templates, and refactor `content` to `page_text` (there's too many "content" already and is confusing) --- .../wiki/src/views/tutorial/views/default.py | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/tutorial/views/default.py b/docs/tutorials/wiki/src/views/tutorial/views/default.py index dfc42c96a..b4b65a49b 100644 --- a/docs/tutorials/wiki/src/views/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/views/tutorial/views/default.py @@ -4,16 +4,18 @@ import re from pyramid.httpexceptions import HTTPFound from pyramid.view import view_config -from .models import Page +from ..models import Page # regular expression used to find WikiWords wikiwords = re.compile(r"\b([A-Z]\w+[A-Z]+\w+)") -@view_config(context='.models.Wiki') + +@view_config(context='..models.Wiki') def view_wiki(context, request): return HTTPFound(location=request.resource_url(context, 'FrontPage')) -@view_config(context='.models.Page', renderer='templates/view.pt') + +@view_config(context='..models.Page', renderer='../templates/view.pt') def view_page(context, request): wiki = context.__parent__ @@ -27,13 +29,14 @@ def view_page(context, request): add_url = request.application_url + '/add_page/' + word return '%s' % (add_url, word) - content = publish_parts(context.data, writer_name='html')['html_body'] - content = wikiwords.sub(check, content) + page_text = publish_parts(context.data, writer_name='html')['html_body'] + page_text = wikiwords.sub(check, page_text) edit_url = request.resource_url(context, 'edit_page') - return dict(page=context, content=content, edit_url=edit_url) + return dict(page=context, page_text=page_text, edit_url=edit_url) -@view_config(name='add_page', context='.models.Wiki', - renderer='templates/edit.pt') + +@view_config(name='add_page', context='..models.Wiki', + renderer='../templates/edit.pt') def add_page(context, request): pagename = request.subpath[0] if 'form.submitted' in request.params: @@ -49,8 +52,9 @@ def add_page(context, request): page.__parent__ = context return dict(page=page, save_url=save_url) -@view_config(name='edit_page', context='.models.Page', - renderer='templates/edit.pt') + +@view_config(name='edit_page', context='..models.Page', + renderer='../templates/edit.pt') def edit_page(context, request): if 'form.submitted' in request.params: context.data = request.params['body'] -- cgit v1.2.3 From db221574993ace9ab0773fe746ff7ae35b474d41 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 03:36:11 -0800 Subject: Delete obsolete views.py --- docs/tutorials/wiki/src/views/tutorial/views.py | 60 ------------------------- 1 file changed, 60 deletions(-) delete mode 100644 docs/tutorials/wiki/src/views/tutorial/views.py (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/tutorial/views.py b/docs/tutorials/wiki/src/views/tutorial/views.py deleted file mode 100644 index fd2b0edc1..000000000 --- a/docs/tutorials/wiki/src/views/tutorial/views.py +++ /dev/null @@ -1,60 +0,0 @@ -from docutils.core import publish_parts -import re - -from pyramid.httpexceptions import HTTPFound -from pyramid.view import view_config - -from .models import Page - -# regular expression used to find WikiWords -wikiwords = re.compile(r"\b([A-Z]\w+[A-Z]+\w+)") - -@view_config(context='.models.Wiki') -def view_wiki(context, request): - return HTTPFound(location=request.resource_url(context, 'FrontPage')) - -@view_config(context='.models.Page', renderer='templates/view.pt') -def view_page(context, request): - wiki = context.__parent__ - - def check(match): - word = match.group(1) - if word in wiki: - page = wiki[word] - view_url = request.resource_url(page) - return '%s' % (view_url, word) - else: - add_url = request.application_url + '/add_page/' + word - return '%s' % (add_url, word) - - content = publish_parts(context.data, writer_name='html')['html_body'] - content = wikiwords.sub(check, content) - edit_url = request.resource_url(context, 'edit_page') - return dict(page=context, content=content, edit_url=edit_url) - -@view_config(name='add_page', context='.models.Wiki', - renderer='templates/edit.pt') -def add_page(context, request): - pagename = request.subpath[0] - if 'form.submitted' in request.params: - body = request.params['body'] - page = Page(body) - page.__name__ = pagename - page.__parent__ = context - context[pagename] = page - return HTTPFound(location=request.resource_url(page)) - save_url = request.resource_url(context, 'add_page', pagename) - page = Page('') - page.__name__ = pagename - page.__parent__ = context - return dict(page=page, save_url=save_url) - -@view_config(name='edit_page', context='.models.Page', - renderer='templates/edit.pt') -def edit_page(context, request): - if 'form.submitted' in request.params: - context.data = request.params['body'] - return HTTPFound(location=request.resource_url(context)) - - return dict(page=context, - save_url=request.resource_url(context, 'edit_page')) \ No newline at end of file -- cgit v1.2.3 From 047394ea8ee37fb9161e8dad7693e82112f40d31 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 03:36:51 -0800 Subject: Add import and return a Page object for the notfound view --- docs/tutorials/wiki/src/views/tutorial/views/notfound.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py index 728791d0a..214ec810e 100644 --- a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py +++ b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py @@ -1,7 +1,12 @@ from pyramid.view import notfound_view_config +from ..models import Page + @notfound_view_config(renderer='../templates/404.pt') def notfound_view(request): request.response.status = 404 - return {} + pagename = request.subpath + page = Page(pagename) + page.__name__ = pagename + return dict(page=page) -- cgit v1.2.3 From 8af7634939d18c0fc1d2118ce46d9848dfe514bf Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 03:39:01 -0800 Subject: Fix up templates to inherit from layout.pt --- .../wiki/src/views/tutorial/templates/404.pt | 10 +++ .../wiki/src/views/tutorial/templates/edit.pt | 76 ++++----------------- .../wiki/src/views/tutorial/templates/layout.pt | 59 ++++++++++++++++ .../wiki/src/views/tutorial/templates/view.pt | 78 ++++------------------ 4 files changed, 97 insertions(+), 126 deletions(-) create mode 100644 docs/tutorials/wiki/src/views/tutorial/templates/404.pt create mode 100644 docs/tutorials/wiki/src/views/tutorial/templates/layout.pt (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/tutorial/templates/404.pt b/docs/tutorials/wiki/src/views/tutorial/templates/404.pt new file mode 100644 index 000000000..07298940c --- /dev/null +++ b/docs/tutorials/wiki/src/views/tutorial/templates/404.pt @@ -0,0 +1,10 @@ +
+
+ +
+

Pyramid Starter project

+

404 Page Not Found

+
+ +
+
diff --git a/docs/tutorials/wiki/src/views/tutorial/templates/edit.pt b/docs/tutorials/wiki/src/views/tutorial/templates/edit.pt index 2db3ca79c..620fcbfb7 100644 --- a/docs/tutorials/wiki/src/views/tutorial/templates/edit.pt +++ b/docs/tutorials/wiki/src/views/tutorial/templates/edit.pt @@ -1,69 +1,21 @@ - - - - - - - - - +
+
- ${page.__name__} - Pyramid tutorial wiki (based on - TurboGears 20-Minute Wiki) - - - - - - - - - - - - -
-
-
-
- -
-
-
-

- Editing - Page Name Goes Here -

-

You can return to the - FrontPage. -

-
+
+

+ Editing + Page Name Goes Here +

+
- +
- +
- -
-
+
-
- -
-
-
- - - - - - - +
+
diff --git a/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt new file mode 100644 index 000000000..ba40fd6f4 --- /dev/null +++ b/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt @@ -0,0 +1,59 @@ + + + + + + + + + + + ${page.__name__} - Pyramid tutorial wiki (based on + TurboGears 20-Minute Wiki) + + + + + + + + + + + + + +
+
+
+
+ +
+
+
No content
+
+

You can return to the + FrontPage. +

+
+
+
+
+ +
+
+
+ + + + + + + + diff --git a/docs/tutorials/wiki/src/views/tutorial/templates/view.pt b/docs/tutorials/wiki/src/views/tutorial/templates/view.pt index 1feeab5ef..b8a6fbbaf 100644 --- a/docs/tutorials/wiki/src/views/tutorial/templates/view.pt +++ b/docs/tutorials/wiki/src/views/tutorial/templates/view.pt @@ -1,70 +1,20 @@ - - - - - - - - - +
+
- ${page.__name__} - Pyramid tutorial wiki (based on - TurboGears 20-Minute Wiki) - - - - - - - - - - - - - -
-
-
-
- -
-
-
-
- Page text goes here. -
-

+

+
+ Page text goes here. +
+

Edit this page -

-

- Viewing - Page Name Goes Here -

-

You can return to the - FrontPage. -

-
-
-
-
- +

+

+ Viewing + Page Name Goes Here +

-
-
- - - - - - - +
+
-- cgit v1.2.3 From 57d8d1fd670b156439ac522fe17988116754d42c Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 03:53:25 -0800 Subject: Fix up template for display on docs --- docs/tutorials/wiki/src/views/tutorial/templates/edit.pt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/tutorial/templates/edit.pt b/docs/tutorials/wiki/src/views/tutorial/templates/edit.pt index 620fcbfb7..488e7a6af 100644 --- a/docs/tutorials/wiki/src/views/tutorial/templates/edit.pt +++ b/docs/tutorials/wiki/src/views/tutorial/templates/edit.pt @@ -9,10 +9,13 @@
+ class="form-control" name="body" + rows="10" cols="60">
- +
-- cgit v1.2.3 From 622a98df9f46805617481c573073901493e601c4 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 12:26:58 -0800 Subject: Use path for pagename, not subpath --- docs/tutorials/wiki/src/views/tutorial/views/notfound.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py index 214ec810e..d44b4d0e6 100644 --- a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py +++ b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py @@ -6,7 +6,7 @@ from ..models import Page @notfound_view_config(renderer='../templates/404.pt') def notfound_view(request): request.response.status = 404 - pagename = request.subpath + pagename = request.path page = Page(pagename) page.__name__ = pagename return dict(page=page) -- cgit v1.2.3 From 7672298e3877e36f12832cc6d6099aefa6173160 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 13:19:22 -0800 Subject: Update theme.css to display text in inputs - See #3431 --- docs/tutorials/wiki/src/views/tutorial/static/theme.css | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/tutorial/static/theme.css b/docs/tutorials/wiki/src/views/tutorial/static/theme.css index 0f4b1a4d4..a70ee557a 100644 --- a/docs/tutorials/wiki/src/views/tutorial/static/theme.css +++ b/docs/tutorials/wiki/src/views/tutorial/static/theme.css @@ -17,6 +17,9 @@ h6 { p { font-weight: 300; } +button, input, optgroup, select, textarea { + color: black; +} .font-normal { font-weight: 400; } -- cgit v1.2.3 From f5355df850ff5abb2e184f74f3acc1bd193d5d72 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 13:29:31 -0800 Subject: Fix template to include either the page name or a title for the title tag --- docs/tutorials/wiki/src/views/tutorial/templates/layout.pt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt index ba40fd6f4..b606e8dad 100644 --- a/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt @@ -8,7 +8,7 @@ - ${page.__name__} - Pyramid tutorial wiki (based on + <title><span tal:replace="page.__name__ | title"></span> - Pyramid tutorial wiki (based on TurboGears 20-Minute Wiki) -- cgit v1.2.3 From 9a47083da48d6967e329ff7e1730854760e66ca6 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 23:31:05 -0800 Subject: Remove settings for tm.manager_hook from __init__.py --- docs/tutorials/wiki/src/views/tutorial/__init__.py | 1 - 1 file changed, 1 deletion(-) (limited to 'docs/tutorials/wiki/src/views') diff --git a/docs/tutorials/wiki/src/views/tutorial/__init__.py b/docs/tutorials/wiki/src/views/tutorial/__init__.py index bd0c71f5b..830a607f3 100644 --- a/docs/tutorials/wiki/src/views/tutorial/__init__.py +++ b/docs/tutorials/wiki/src/views/tutorial/__init__.py @@ -12,7 +12,6 @@ def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ with Configurator(settings=settings) as config: - settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' config.include('pyramid_tm') config.include('pyramid_retry') config.include('pyramid_zodbconn') -- cgit v1.2.3