Modify an object

Hi there,

I've an object with the filed "hasDownloaded" who is a int.
The object:
http://kalipso.sysdevmobile.com/en/TrialDownloads/TD1511282082641-561029

I need to modify this field without using /manage_propertiesForm ( by code) when someone load this object view, on other word I need to increment the int "hasDownloaded" each time the trialdownload_view is "loaded".

thanks

So you have a custom content type called "TrialDownload"

You could create a custom browser view and associated it with the "TrialDownload" content type. It would write to the hasDownloaded field whenever it is called.

You may run into CSRF issues with plone.protect. If you do, this article will help you http://devblog.4teamwork.ch/blog/2015/10/12/debugging-csrf-protection-false-positives-in-plone/

I'm not sure if this is the ideal solution but it should work.

Are you sure you need to do it that way ?
I am thinking: the 'normal file' download is actually a (browser) view. You could maybe override this for your content type and do the counting in the view, and 'save 'the results' from there
I dont think you need a field, especially if there is just one download you want to track.

Just for information: a 'normal' download link should be something like http://site/path/to/file/@@download

Hi,

Its a view with 2 buttons, they only download the file if they click into the button and I need to count it.