robhudson/zamboni — comment on commit bff22583f62136e13d6c73e2ebfe0af494e23dc9
File: apps/api/utils.py line 119
By cvan:

this doesn't seem like something we should be magically generating, especially from `amo.ADDON_TYPE`.

I tried using `amo.ADDON_SLUGS_UPDATE`, which won't completely work for you. but it's a start:

In [20]: types
Out[20]:
{u'any': 0,
u'dictionary': 3,
u'extension': 1,
u'language': 5,
u'persona': 9,
u'search': 4,
u'theme': 2}

In [21]: dict([(v, k) for k, v in amo.ADDON_SLUGS_UPDATE.items()])
Out[21]:
{'app': 11,
'extension': 6, # this is wrong, because non-extensions (e.g., language packs) are called extensions!
'item': 5,
'persona': 9,
'plugin': 7,
'search': 4,
'theme': 2}

your best bet is adding a `dict` to https://github.com/mozilla/zamboni/blob/master/apps/constants/base.py#L143 which we can reference later.