def item_lists_by_domain(domain): ret = list() for data_type in FixtureDataType.by_domain(domain): structure = { f.field_name: { 'name': f.field_name, 'no_option': True } for f in data_type.fields } for attr in data_type.item_attributes: structure['@' + attr] = {'name': attr, 'no_option': True} uri = 'jr://fixture/%s:%s' % (ItemListsProvider.id, data_type.tag) ret.append({ 'id': data_type.tag, 'uri': uri, 'path': "/{tag}_list/{tag}".format(tag=data_type.tag), 'name': data_type.tag, 'structure': structure, }) products = product_fixture_generator_json(domain) if products: ret.append(products) programs = program_fixture_generator_json(domain) if programs: ret.append(programs) return ret
def item_lists_by_domain(domain): ret = list() for data_type in FixtureDataType.by_domain(domain): structure = { f.field_name: { 'name': f.field_name, 'no_option': True } for f in data_type.fields } for attr in data_type.item_attributes: structure['@' + attr] = {'name': attr, 'no_option': True} uri = 'jr://fixture/%s:%s' % (ItemListsProvider.id, data_type.tag) ret.append({ 'id': data_type.tag, 'uri': uri, 'path': "/{tag}_list/{tag}".format(tag=data_type.tag), 'name': data_type.tag, 'structure': structure, }) products = product_fixture_generator_json(domain) if products: ret.append(products) programs = program_fixture_generator_json(domain) if programs: ret.append(programs) return ret