I would like to make programmatically (with Python) the same thing than we can do directly in QGIS when you create a list of values for a field.
I would like to create a new field and specify a list of possible values for this field. I didn't find any function for that in the API. Is there anyone who has the solution?