def __init__(self, env, options): Type.__init__(self, env, options) self.extra_params = { 'doctitle_xform': False, 'initial_header_level': '2', 'syntax_highlight': 'short'} self.extra_params.update(options)
def __init__(self, env, options): Type.__init__(self, env, options) self.extra_params = { 'doctitle_xform': False, 'initial_header_level': '2', 'syntax_highlight': 'short' } self.extra_params.update(options)
def to_json(self, pad, record=None, alt=PRIMARY_ALT): rv = Type.to_json(self, pad, record, alt) rv["flowblocks"] = discover_relevant_flowblock_models(self, pad, record, alt) block_order = self.flow_blocks if block_order is None: block_order = [k for k, v in sorted(pad.db.flowblocks.items(), key=lambda x: x[1].order)] rv["flowblock_order"] = block_order return rv
def to_json(self, pad, record=None, alt=PRIMARY_ALT): rv = Type.to_json(self, pad, record, alt) rv["flowblocks"] = discover_relevant_flowblock_models(self, pad, record, alt) block_order = self.flow_blocks if block_order is None: block_order = [ k for k, v in sorted(pad.db.flowblocks.items(), key=lambda x: x[1].order) ] rv["flowblock_order"] = block_order return rv
def to_json(self, pad): rv = Type.to_json(self, pad) rv['checkbox_label'] = self.options.get('checkbox_label') return rv
def to_json(self, pad): rv = Type.to_json(self, pad) if self.source.has_choices: rv['choices'] = [[key, value] for key, value in self.source.iter_choices(pad)] return rv
def __init__(self, env, options): Type.__init__(self, env, options) self.source = ChoiceSource(env, options)
def __init__(self, env, options): Type.__init__(self, env, options)
def to_json(self, pad, record=None, alt=PRIMARY_ALT): rv = Type.to_json(self, pad, record, alt) rv['checkbox_label_i18n'] = get_i18n_block( self.options, 'checkbox_label') return rv
def to_json(self, pad, record=None, alt=PRIMARY_ALT): rv = Type.to_json(self, pad, record, alt) if self.source.has_choices: rv['choices'] = list(self.source.iter_choices(pad, record, alt)) return rv
def to_json(self, pad, record=None, alt=PRIMARY_ALT): rv = Type.to_json(self, pad, record, alt) rv["is_fake_type"] = True return rv
def __init__(self, env, options): Type.__init__(self, env, options) self.flow_blocks = [x.strip() for x in options.get("flow_blocks", "").split(",") if x.strip()] or None
def __init__(self, env, options, client_id, client_secret, access_token=None): Type.__init__(self, env, options) self.client_id = client_id self.client_secret = client_secret self.access_token = access_token
def to_json(self, pad): rv = Type.to_json(self, pad) rv['flowblocks'] = dict((k, v.to_json(pad)) for k, v in pad.db.flowblocks.iteritems()) return rv
def to_json(self, pad, record=None, alt=PRIMARY_ALT): rv = Type.to_json(self, pad, record, alt) rv['is_fake_type'] = True return rv
def __init__(self, env, options): Type.__init__(self, env, options) self.flow_blocks = [ x.strip() for x in options.get("flow_blocks", "").split(",") if x.strip() ] or None
def to_json(self, pad): rv = Type.to_json(self, pad) rv['flowblocks'] = dict( (k, v.to_json(pad)) for k, v in pad.db.flowblocks.iteritems()) return rv
def to_json(self, pad, record=None, alt=PRIMARY_ALT): rv = Type.to_json(self, pad, record, alt) rv['addon_label_i18n'] = get_i18n_block( self.options, 'addon_label') or None return rv
def __init__(self, env, options): Type.__init__(self, env, options) self.flow_blocks = [ x.strip() for x in options.get('flow_blocks', '').split(',') if x.strip() ] or None
def __init__(self, env, options): Type.__init__(self, env, options) self.flow_blocks = [ x.strip() for x in options.get('flow_blocks', '').split(',') if x.strip()] or None