I ran into an interesting issue today. I'm having some trouble testing a database-backed class that uses a mixin, but needs to register triggers for a column that is created after register_triggers() has already been called. Which is pretty much always the case unless you reload Jifty completely after creating all the columns.
I can think of a couple good solutions and I'm thinking of implementing both: 1. Virtual models branch change: Add a new register_triggers_late()method that is only called on database-backed models when a column is created after register_triggers() has been called. It would pass the new column info to the method so it could do any column-specific trigger updates. This would allow a mixin that may need to implement additional triggers on new database-backed columns to do so without mucking with the existing API. 2. Trunk change: Add two new "pseudo-triggers" before_any_set and after_any_set. Setting a before_any_set trigger would cause a before_set_X trigger to be set for every column on the table. The after_any_set trigger would do the same for after_set_X. The virtual models branch would then add these triggers to any new column as they are created as well. Any objections/suggestions? Cheers, Andrew
_______________________________________________ jifty-devel mailing list [email protected] http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
