Added transaction commitment to command

pull/1/head
Raymond Yee 2012-03-29 15:05:26 -07:00
parent 1b9d54037a
commit decdac290c
1 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,8 @@ class Command(BaseCommand):
d: delete all tasks
an integer: compute factorial of the integer -- can then follow up with s to find the state
"""
import django
django.db.transaction.enter_transaction_management()
if action == 'c':
for i in xrange(int(num_tasks)):
n = random.randint(1,1000)
@ -56,4 +58,4 @@ class Command(BaseCommand):
ct.save()
except Exception, e:
print e
django.db.transaction.commit()