Skip to content

Instantly share code, notes, and snippets.

View pgrunewald's full-sized avatar

Paul Grunewald pgrunewald

View GitHub Profile
""" Custom Add/Edit forms
"""
from zope import schema
from zope.component import queryAdapter
from zope.component import provideAdapter
from z3c.form.browser.checkbox import CheckBoxFieldWidget
from z3c.form.browser.radio import RadioFieldWidget
from plone.dexterity.browser import edit
from plone.dexterity.browser import add
from eea.facetednavigation.interfaces import ICriteria
@lukasgraf
lukasgraf / trace_register.py
Created October 11, 2015 15:34
CSRF debug helper: Trace object registrations
"""Helper to trace ZODB object registrations in order to debug CSRF false
positives with plone.protect.
This helper is intended for DEBUGGING, not for use in production!
"""
from collections import namedtuple
from functools import partial
from threading import local
from ZODB.utils import u64