How to store a list of bundles in a select field (programmatically)? I need to be able to present a list of available bundles (in this case, Commerce Line Item types) as a select field on an entity, so I can use the value in a custom module. Suggestions?

I've tried creating a select list (using commerce_line_item_type_get_name) and then populating the field's "allowed values" programmatically, but the problem is that when bundles are added/removed, I can't change the allowed values if data is already stored. I don't actually need this kind of data management, as it doesn't matter if stored values reference a bundle that no longer exists. Perhaps I don't need a select list, but a textfield with a dropdown menu input widget or something? I would appreciate any advice on how to proceed.

Thanks! :)
I've found that there is an "allowed values function" setting for list fields. Perfect! :)

http://www.phase2technology.com/blog/setting-the-allowed-values-function-property-on-text-fields/