Hi everyone,
I'm currently looking to update the value of a specific dexterity content field based on userinteraction with a view. See the following field from the content type schema as an example:
items = schema.List(
title=_(u'List'),
value_type=schema.Text(),
required=False,
)
Based on how the user interacts with the view, I'm looking to delete
certain indexes in that persistent list. I've read up a bit on transactions and think I could do something along the lines of:
new_items = ['updated', 'list', 'content']
context.items = new_items
transactions.commit()
This would be initiated using <input type="submit"...
. Apart from making the transactions permanent, I've gotten this approach working (i.e I can execute the function when the user interacts with the form and update the list for the moment without saving it). But I am unsure wether this approach is safe, what it's drawbacks are and/or if there is a more prefered way of achieving this functionallity through code. What is the prefered way of updating the contents of a dexterity content field through code?
Kind regards, Tony.