Skip to content

Generating a list of multiple configs from inside a config group #435

Answered by DirkKuhn
DirkKuhn asked this question in Q&A
Discussion options

You must be logged in to vote

I think I found the answer:

ItemAConf = builds(Item, msg='a')
ItemBConf = builds(Item, msg='b')
ItemCConf = builds(Item, msg='c')

default_items = [ItemAConf, ItemBConf]

ItemListConf = just(default_items)
FullItemListConf = just(default_items + [ItemCConf])

items_store = store(group='repository/items')
items_store(ItemAConf, name='item_a')
items_store(ItemBConf, name='item_b')
items_store(ItemCConf, name='item_c')
items_store(ItemListConf, name='default')
items_store(FullItemListConf, name='full')

Can someone please confirm whether this is the right way?

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@rsokl
Comment options

Answer selected by DirkKuhn
Comment options

You must be logged in to vote
1 reply
@rsokl
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants