Created
October 20, 2012 21:36
-
-
Save maxivak/3924899 to your computer and use it in GitHub Desktop.
Django: raw SQL - UPDATE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import connection, transaction | |
cursor = connection.cursor() | |
cursor.execute("UPDATE yourtablename SET field1=value1, .. WHERE .. ") | |
transaction.set_dirty() | |
transaction.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment