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.
Please login to continue.