To sort the items in a view can be done (for example) like this:
self.context.restrictedTraverse('@@contentlisting')(sort_on='sortable_title', batch=True, b_size=40);
But in my case, I want some python code to sort items in the folder alphabetically.
The main reason for this is that I want a) some users to 'check some documents, and when done: move them and b) see if there i duplicate content (there is a mix of 'number Name' and 'Name Number' in the filenames) and I dont want these to 'move automatically after we change them (as they would in a collection)
I have loads (thousands) of folders, so I would prefer to do it by code.