This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def attr_migrator(old, new, old_name, new_name): | |
field = old.getField(old_name) | |
if not field: | |
return | |
val = field.get(old) | |
val_str = str(val) | |
if old_name == 'teacher': | |
if not isinstance(val, list): | |
val = [] | |
teachers = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[buildout] | |
parts = instance | |
extends = http://dist.plone.org/release/4-latest/versions.cfg | |
find-links = http://dist.repoze.org/ | |
versions = versions | |
[instance] | |
recipe = plone.recipe.zope2instance | |
eggs = | |
Plone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am thet on github. | |
* I am thet (https://keybase.io/thet) on keybase. | |
* I have a public key whose fingerprint is 8667 B704 EBB4 8E94 447F 5EF6 5B89 8D31 0C43 8007 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Per instance behaviors for Plone's Dexterity. | |
<adapter | |
for=".interfaces.IBasetype" | |
factory=".instancebehaviors.DexterityInstanceBehaviorAssignable" /> | |
Also see: | |
http://opkode.net/media/blog/plone-and-dexterity-enable-behaviors-per-content-type-instance | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Products.Archetypes.Field import * | |
from Products.Archetypes.Storage import * | |
from Products.Archetypes.Widget import * | |
from Products.Archetypes.fieldproperty import ATDateTimeFieldProperty | |
from Products.Archetypes.fieldproperty import ATFieldProperty | |
from Products.Archetypes.athistoryaware import ATHistoryAwareMixin | |
from Products.Archetypes.fieldproperty import ATReferenceFieldProperty | |
from Products.Archetypes.annotations import AT_ANN_STORAGE | |
from Products.Archetypes.annotations import AT_FIELD_MD | |
from Products.Archetypes.ClassGen import AT_GENERATE_METHOD |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[buildout] | |
parts = | |
instance | |
zopepy | |
test | |
packages | |
extends = | |
https://raw.github.com/plone/buildout.coredev/5.0/sources.cfg | |
https://raw.github.com/plone/buildout.coredev/5.0/checkouts.cfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Toggle touchpad scrolling on Gnome 3 via dconf/gsettings between | |
# 'two-finger-scrolling' and 'edge-scrolling'. | |
# This can be useful for touchpad users using two-finger-scoll and want | |
# to open the context menu via two-finger-click on the right position. | |
CURRENT=$(gsettings get org.gnome.desktop.peripherals.touchpad scroll-method) | |
echo $CURRENT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from Products.CMFCore.utils import getToolByName | |
from plone.app.textfield.value import RichTextValue | |
from zope.component.hooks import getSite | |
import logging | |
log = logging.getLogger(__name__) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<registry xmlns:i18n="http://xml.zope.org/namespaces/i18n"> | |
<!-- Add ``object_provides`` criteria to query string for use in collections. | |
Put code in ``registry.xml`` and create a .tar.gz, then upload it via | |
portal_setup and make sure to untick "Purge existing settings". --> | |
<records interface="plone.app.querystring.interfaces.IQueryField" | |
prefix="plone.app.querystring.field.object_provides"> | |
<value key="title">object_provides</value> | |
<value key="description">Search for provided interfaces</value> | |
<value key="enabled">True</value> | |
<value key="sortable">True</value> |
OlderNewer