Hi All,

I want to detect if there is a change in auth_user table for 
registeration_key field. I have implemented the following code :-

Models :

db.auth_user._before_update.append(lambda s,f: before_trigger_auth(s,f))
db.auth_user._after_update.append(lambda s,f: after_trigger_auth(s,f))

Modules :

def before_trigger_auth(*args):
    print args
    print "before"
    f = args[1]
    rkey = f['registration_key']
    current.session.before_rkey = rkey
    
def after_trigger_auth(*args):
    print args
    print "after"
    f = args[1]
    rkey = f['registration_key']
    if current.session.before_rkey:
        if current.session.before_rkey == "pending" and rkey == "":
            del current.session.before_rkey
            ruseremail = f['email']
            print "Trigger an email update"


Now when I am editing the db.auth_user table record (using appadmin) to 
delete the pending word from registeration_key, I have noticed that the 
results from both and after callbacks were same i.e. registeration_key was 
empty. 

If I add the "pending" word in registration_key, then also I get the same 
results from both the after and before callbacks.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to