Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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['addon_label_i18n'] = get_i18n_block(
self.options, 'addon_label') or None
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 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(iteritems(pad.db.flowblocks),
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['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)
rv['addon_label_i18n'] = get_i18n_block(
self.options, 'addon_label') or None
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