Created
April 26, 2016 03:42
-
-
Save zopyx/75eeccb38e23dbaa817cac9d87d0e270 to your computer and use it in GitHub Desktop.
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 context_property(name, default=None): | |
def getter(self, default=default): | |
return getattr(self.context, name, default) | |
def setter(self, value): | |
setattr(self.context, name, value) | |
def deleter(self): | |
delattr(self.context, name) | |
return property(getter, setter, deleter) | |
class Guideline(object): | |
""" Adapter for Guideline """ | |
implements(IGuideline) | |
adapts(IDexterityContent) | |
def __init__(self, context): | |
self.context = context | |
gl_language = context_property('gl_language') | |
gl_state = context_property('gl_state', '') | |
gl_date = context_property('gl_date', '') | |
gl_area = context_property('gl_area') | |
gl_guideline_topics = context_property('gl_guideline_topics', None) | |
gl_id = context_property('gl_id') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment