I hereby claim:
- I am mmerickel on github.
- I am mmerickel (https://keybase.io/mmerickel) on keybase.
- I have a public key whose fingerprint is CC1A 48C9 57AC 6ABE F05B 2C59 6BC9 77B0 56B8 29E5
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
from pyramid.interfaces import IRequest | |
from zope.interface.registry import Components | |
def includeme(config): | |
config.add_request_method(find_service) | |
config.add_request_method(lambda _: Components(), 'service_cache', | |
reify=True) | |
config.add_directive('register_service', register_service) | |
config.add_directive('register_service_factory', register_service_factory) |
diff --git a/pyramid/router.py b/pyramid/router.py | |
index ba4f85b..a11e556 100644 | |
--- a/pyramid/router.py | |
+++ b/pyramid/router.py | |
@@ -1,10 +1,12 @@ | |
from zope.interface import ( | |
implementer, | |
providedBy, | |
+ Interface, | |
) |
import logging.config | |
import os.path | |
from alembic import context | |
from sqlalchemy import create_engine, pool | |
# this is the Alembic Config object, which provides | |
# access to the values within the .ini file in use. | |
config = context.config |
from .meta import DBSession | |
from .users import User | |
from .entries import Entry |
import React from 'react'; | |
import {connect} from 'redux/react'; | |
import {bindActions} from './utils/bindActions'; | |
import * as Actions from './actions'; | |
@connect(state => ({ | |
activePage: state.activePage, | |
})) | |
@bindActions({ |
def commit_veto(environ, status, headers): | |
for good in ('1', '2', '3'): | |
if status.startswith(good): | |
break | |
else: | |
return True | |
for header_name, header_value in headers: | |
if header_name.lower() == 'x-tm-abort': | |
return True |
class DayZeroContainer(ModelContainer): | |
def __init__(self, request, cls): | |
self.cls = cls | |
self.request = request | |
@property | |
def __acl__(self): | |
return [ | |
(Allow, 'owner:{0}'.format(cls.ownerid), ('add', 'edit)), | |
# ... some other acls for this particular resource? |
# tutorial/__init__.py | |
from pyramid.config import Configurator | |
from tutorial.model.meta import init_model | |
from tutorial.request import TutorialRequest | |
def main(global_config, **settings): | |
init_model(settings) |
from pyramid.decorator import reify | |
from pyramid_traversalwrapper import LocationProxy | |
class traversable_attrs(object): | |
""" A decorator that adds a "wrap" attribute to the given class | |
in the form of a dict-like class that does item lookup based on | |
the attrs given. | |
""" |