Is there a better way to do the following in a django Model method? The following looks quite verbose, as I could do the same in the SQL shell with one line:
class ItemMaster(models.Model):
...
@classmethod
@transaction.commit_manually
def update_imdb_rank(self):
'''
Update all ranks from the IMDbEntry table
'''
cursor = connection.cursor()
cursor.execute("UPDATE main_itemmaster i JOIN mturk_imdbentry m USING (imdb_url) SET i.imdb_rank=m.imdb_rank")
transaction.commit()
imdb_url?