Created
July 15, 2016 06:09
-
-
Save zopyx/193412b48621e0f55e72e77abd3d2bce 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