Changes between Version 115 and Version 116 of DeveloperGuidelines/Tips


Ignore:
Timestamp:
11/16/11 10:39:56 (10 years ago)
Author:
Fran Boon
Comment:

Web2Py query debugging

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Tips

    v115 v116  
    1515calframe = inspect.getouterframes(curframe, 2)
    1616print 'caller name:', calframe[1][3]
     17}}}
     18 * Debug SQL Queries:
     19{{{
     20vi gluon/dal.py
     21class BaseAdapter()
     22    def select():
     23        def response(sql):
     24            if "searchphrase" in sql:
     25                print >> sys.stderr, "Query: %s" % query
     26                print >> sys.stderr, "SQL: %s" % sql
    1727}}}
    1828 * [http://aymanh.com/python-debugging-techniques Python Debugging Techniques]