def get_variables(event): v = copy.copy(DEFAULT_VARIABLES) scheme = PERSON_NAME_SCHEMES[event.settings.name_scheme] for key, label, weight in scheme['fields']: v['attendee_name_%s' % key] = { 'label': _("Attendee name: {part}").format(part=label), 'editor_sample': scheme['sample'][key], 'evaluate': partial(_get_attendee_name_part, key) } for i in range(2, len(scheme['fields']) + 1): for comb in itertools.combinations(scheme['fields'], i): v['attendee_name_%s' % ('_'.join(c[0] for c in comb))] = { 'label': _("Attendee name: {part}").format(part=' + '.join(str(c[1]) for c in comb)), 'editor_sample': ' '.join(str(scheme['sample'][c[0]]) for c in comb), 'evaluate': partial(_get_attendee_name_part, comb) } v['invoice_name']['editor_sample'] = scheme['concatenation'](scheme['sample']) v['attendee_name']['editor_sample'] = scheme['concatenation'](scheme['sample']) for key, label, weight in scheme['fields']: v['invoice_name_%s' % key] = { 'label': _("Invoice address name: {part}").format(part=label), 'editor_sample': scheme['sample'][key], "evaluate": partial(_get_ia_name_part, key) } for recv, res in layout_text_variables.send(sender=event): v.update(res) return v
def get_variables(event): v = copy.copy(DEFAULT_VARIABLES) scheme = PERSON_NAME_SCHEMES[event.settings.name_scheme] for key, label, weight in scheme['fields']: v['attendee_name_%s' % key] = { 'label': _("Attendee name: {part}").format(part=label), 'editor_sample': scheme['sample'][key], 'evaluate': partial(_get_attendee_name_part, key) } v['invoice_name']['editor_sample'] = scheme['concatenation']( scheme['sample']) v['attendee_name']['editor_sample'] = scheme['concatenation']( scheme['sample']) for key, label, weight in scheme['fields']: v['invoice_name_%s' % key] = { 'label': _("Invoice address name: {part}").format(part=label), 'editor_sample': scheme['sample'][key], "evaluate": partial(_get_ia_name_part, key) } for recv, res in layout_text_variables.send(sender=event): v.update(res) return v
def get_variables(event): v = copy.copy(DEFAULT_VARIABLES) scheme = PERSON_NAME_SCHEMES[event.settings.name_scheme] for key, label, weight in scheme['fields']: v['attendee_name_%s' % key] = { 'label': _("Attendee name: {part}").format(part=label), 'editor_sample': scheme['sample'][key], 'evaluate': lambda op, order, ev: op.attendee_name_parts.get(key, '') } v['invoice_name']['editor_sample'] = scheme['concatenation'](scheme['sample']) v['attendee_name']['editor_sample'] = scheme['concatenation'](scheme['sample']) for key, label, weight in scheme['fields']: v['invoice_name_%s' % key] = { 'label': _("Invoice address name: {part}").format(part=label), 'editor_sample': scheme['sample'][key], "evaluate": lambda op, order, ev: order.invoice_address.name_parts.get(key, '') if getattr(order, 'invoice_address', None) else '' } for recv, res in layout_text_variables.send(sender=event): v.update(res) return v
def get_variables(event): v = copy.copy(DEFAULT_VARIABLES) scheme = PERSON_NAME_SCHEMES[event.settings.name_scheme] for key, label, weight in scheme['fields']: v['attendee_name_%s' % key] = { 'label': _("Attendee name: {part}").format(part=label), 'editor_sample': scheme['sample'][key], 'evaluate': lambda op, order, ev: op.attendee_name_parts.get(key, '') } v['invoice_name']['editor_sample'] = scheme['concatenation']( scheme['sample']) v['attendee_name']['editor_sample'] = scheme['concatenation']( scheme['sample']) for key, label, weight in scheme['fields']: v['invoice_name_%s' % key] = { 'label': _("Invoice address name: {part}").format(part=label), 'editor_sample': scheme['sample'][key], "evaluate": lambda op, order, ev: order.invoice_address.name_parts.get( key, '') if getattr(order, 'invoice_address', None) else '' } for recv, res in layout_text_variables.send(sender=event): v.update(res) return v
def get_variables(event): v = copy.copy(DEFAULT_VARIABLES) scheme = PERSON_NAME_SCHEMES[event.settings.name_scheme] for key, label, weight in scheme['fields']: v['attendee_name_%s' % key] = { 'label': _("Attendee name: {part}").format(part=label), 'editor_sample': scheme['sample'][key], 'evaluate': partial(_get_attendee_name_part, key) } v['invoice_name']['editor_sample'] = scheme['concatenation'](scheme['sample']) v['attendee_name']['editor_sample'] = scheme['concatenation'](scheme['sample']) for key, label, weight in scheme['fields']: v['invoice_name_%s' % key] = { 'label': _("Invoice address name: {part}").format(part=label), 'editor_sample': scheme['sample'][key], "evaluate": partial(_get_ia_name_part, key) } for recv, res in layout_text_variables.send(sender=event): v.update(res) return v
def get_variables(event): v = copy.copy(DEFAULT_VARIABLES) for recv, res in layout_text_variables.send(sender=event): v.update(res) return v