Closed mfrasca closed 8 years ago
I've used SQLAlchemy events for this (http://docs.sqlalchemy.org/en/rel_1_0/orm/events.html) which will work in a single user environment but if multiple user's are using the same database then one client won't pick up the changes from another client. That would probably require a database trigger and some polling.
hi Brett, thanks for hint. I am aware of the multiuser and database trigger complication.
mario@rune:~$ cd Local/github/Bauble/bauble.classic
mario@rune:~/Local/github/Bauble/bauble.classic$ grep -rn event.listen bauble
mario@rune:~/Local/github/Bauble/bauble.classic$
my question was whether there was such a structure already in Bauble, if presenters are alerted by the framework. the above grep seems to tell me that if a presenter wants to be notified it should register its own listeners. I will probably do this for just the presenter I'm working at (the one for the initial home screen).
@mfrasca I think this must have been the old way to do it in SQLAlchemy before the @event.listen
descriptors: https://github.com/Bauble/bauble.classic/blob/master/bauble/plugins/garden/accession.py#L370
@brettatoms thanks, I will look into it.
it's very low priority: the user just hits again the home
icon and things are back to fine.
mostly a note to myself :
I think what I was looking for was a common update
method in the views...
what I found which served me: SearchView.reset_view
.
why was I looking for an update method ? »update« is the name of the InfoBox
method.
since the method does not really reset the view (the verb used in the docstring is to update) and it is invoked in just a very few places (twice internally and twice first making sure it is a view of the correct type), I think I will rename it to update
.
I am looking for something that gets activated any time there's a change to the database. I need that for, at least, updating the initial screen after a database change.