In trunk, there are now triggers for DAL tables:

        self._before_insert = []
        self._before_update = [lambda self,fs:self.delete_uploaded_files(fs
)]
        self._before_delete = [lambda self:self.delete_uploaded_files()]
        self._after_insert = []
        self._after_update = []
        self._after_delete = []

You could define a function that stores a timestamp in the cache and add it 
to the three "_after_" triggers for the relevant tables. Then just check 
the timestamp to see if it is more recent than the last request. To 
determine the time of the last request, you could store a timestamp in the 
session upon each request (so it will be specific to each user).

Anthony

On Wednesday, June 6, 2012 5:30:56 AM UTC-4, Omri Har-Shemesh wrote:
>
> Is it possible to watch a table for changes and define a callback whenever 
> the table is changed?
> I am trying to implement a mechanism where the client is asking for data 
> every 5 seconds from the server
> and the server should only return not a null value whenever the data has 
> changed. The problem is that
> the data is quite complex and is inferred from several tables. Therefore, 
> in order to save processing time,
> I want to calculate this data and return it only when I know it has 
> changed.
>
> Thanks,
> Omri
>

Reply via email to