db.models.query.QuerySet.raw()

raw(raw_query, params=None, translations=None)

Takes a raw SQL query, executes it, and returns a django.db.models.query.RawQuerySet instance. This RawQuerySet instance can be iterated over just like an normal QuerySet to provide object instances.

See the Performing raw SQL queries for more information.

Warning

raw() always triggers a new query and doesn’t account for previous filtering. As such, it should generally be called from the Manager or from a fresh QuerySet instance.

doc_Django
2016-10-09 18:36:17
Comments
Leave a Comment

Please login to continue.