2013-04-22 22:18:48 +04:00
|
|
|
from django.db import transaction
|
|
|
|
|
|
|
|
from market.models import Price
|
|
|
|
|
|
|
|
|
|
|
|
@transaction.commit_on_success
|
|
|
|
def run():
|
|
|
|
print 'Renaming tiers'
|
2013-09-05 21:17:55 +04:00
|
|
|
for k, tier in enumerate(Price.objects.no_cache().filter(active=True)
|
2013-04-22 22:18:48 +04:00
|
|
|
.order_by('price')):
|
|
|
|
new = 'Tier %s' % k
|
|
|
|
print 'Renaming %s to %s' % (tier.name, new)
|
|
|
|
tier.name = new
|
|
|
|
tier.save()
|