Thank you. Your aid is incalculable as always. I'll use a descriptor for this case as you well advise.
On 22 dic, 03:40, Michael Bayer <mike...@zzzcomputing.com> wrote: > oh, yeah for that recipe you'd have to use a flag on the mapper() > called "batch=False". But don't use that, its inefficient. > > So you can also create your type to detect a special value from the > mapper extension: > > def before_insert(self, ....): > instance.password = (instance.password, True) > > class MyType(...): > ... > > def process_bind_param(self, value, dialect): > if isinstance(value, tuple): > return hasher.create(value[0], value[1]) > .... > > But since this is really an instance-level business rule, a straight > descriptor and no custom type is definitely how I'd go on this one. > > On Dec 21, 2008, at 6:47 PM, Kless wrote: > > 2) It's necessary to use *session.commit()* after of each record > > because else it will have the value of 'instance.admin' of the last > > record which will be used for all records to commit. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---