Skip to content

Commit

Permalink
Import price tiers (bug 685586)
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Short committed Sep 23, 2011
1 parent 135f820 commit 6e1878c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions migrations/249-more-expensive-products.sql
@@ -0,0 +1,2 @@
ALTER TABLE `prices` MODIFY `price` numeric(7, 2) NOT NULL;
ALTER TABLE `price_currency` MODIFY `price` numeric(7, 2) NOT NULL;
12 changes: 12 additions & 0 deletions migrations/250-initial-price-tiers.py
@@ -0,0 +1,12 @@
from decimal import Decimal
from market.models import Price

tiers = [Decimal(x) for x in
'0.99', '1.99', '2.99', '3.99', '4.99', '5.99', '6.99', '7.99', '8.99',
'9.99', '10.99', '11.99', '12.99', '13.99', '14.99', '15.99', '16.99',
'17.99', '18.99', '19.99', '20.99', '21.99', '22.99', '23.99', '24.99',
'29.99', '34.99', '39.99', '44.99', '49.99']

def run():
for i, price in enumerate(tiers, 1):
Price.objects.create(price=price, name='Tier %s' % (i,))

0 comments on commit 6e1878c

Please sign in to comment.