Posted By

inreflection7 on 10/25/12


Versions (?)

Django DB alias and queries

 / Published in: Python

Useful when used with views

  1. def print_queries():
  2. from django.db import connections
  3. for connection in connections.all():
  4. print "queries for %s:"%(connection.alias,)
  5. for i, query in enumerate(connection.queries):
  6. print "%s: %s"%(i, query)

Report this snippet  

You need to login to post a comment.