Skip to content

Commit

Permalink
Merge pull request #800 from eddieferrer/new_shoes_may_2024
Browse files Browse the repository at this point in the history
added shoes and brand
  • Loading branch information
eddieferrer authored May 10, 2024
2 parents 1940199 + e25a727 commit bd22b62
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 4 deletions.
5 changes: 4 additions & 1 deletion backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ def serialize(self):
# 28|unparallel|US
# 29|rock on|US
# 30|acopa|US
# 31|wildclimb|EUR



CONSTANT_BRANDS = [
Expand Down Expand Up @@ -385,7 +387,8 @@ def serialize(self):
'black diamond',
'unparallel',
'rock on',
'acopa']
'acopa',
'wildclimb']


class Brand(db.Model):
Expand Down
3 changes: 0 additions & 3 deletions batch_discount_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@
process = 'production_manage.py'

argument_list = [
'--feed=adidas_outdoor',
'--feed=backcountry',
'--feed=blackdiamondequipment',
'--feed=bentgate',
'--feed=campsaver',
'--feed=ems',
'--feed=lasportiva',
'--feed=leftlanesports',
'--feed=moosejaw',
'--feed=rei',
'--feed=theclymb'
]

currentDate = datetime.datetime.today()
Expand Down
90 changes: 90 additions & 0 deletions migrations/versions/1047db5fdc34_new_shoes_may_2024.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
"""new shoes may-2024
Revision ID: 1047db5fdc34
Revises: 44dd67063089
Create Date: 2024-05-09 19:52:16.913304
"""

# revision identifiers, used by Alembic.
revision = '1047db5fdc34'
down_revision = '44dd67063089'

from alembic import op
from sqlalchemy.sql import table, column
from sqlalchemy import String, Integer

def upgrade():
# brand 31 wildclimb
brand_table = table('brand',
column('name', String)
)
op.bulk_insert(brand_table,
[
{'name': 'wildclimb'},
]
)

# Create an ad-hoc table to use for the insert statement.
item_table = table('item',
column('model', String),
column('brand_id', Integer),
column('gender_id', Integer),
column('small_image_url', String),
column('medium_image_url', String),
column('type', String)
)

# 5|Scarpa|EUR
op.bulk_insert(item_table,
[
{'model':'generator v', 'brand_id':'5', 'gender_id':'1'},
{'model':'generator v', 'brand_id':'5', 'gender_id':'2'},
]
)

# 3|LaSportiva|EUR
op.bulk_insert(item_table,
[
{'model':'mythos eco', 'brand_id':'3', 'gender_id':'1'},
{'model':'mythos eco', 'brand_id':'3', 'gender_id':'2'},
]
)

# 10|eb|EUR
op.bulk_insert(item_table,
[
{'model':'nebula', 'brand_id':'10', 'gender_id':'3'},
{'model':'balboa', 'brand_id':'10', 'gender_id':'3'},
{'model':'strange', 'brand_id':'10', 'gender_id':'3'},
{'model':'black opium', 'brand_id':'10', 'gender_id':'3'},
{'model':'strange', 'brand_id':'10', 'gender_id':'3'},
{'model':'red', 'brand_id':'10', 'gender_id':'3'},
{'model':'split', 'brand_id':'10', 'gender_id':'3'},
{'model':'electron', 'brand_id':'10', 'gender_id':'3'},
{'model':'mojo', 'brand_id':'10', 'gender_id':'3'},
{'model':'torch lace', 'brand_id':'10', 'gender_id':'3'},
{'model':'torch', 'brand_id':'10', 'gender_id':'3'},
]
)
# 31|wildclimb|EUR
op.bulk_insert(item_table,
[
{'model':'mangusta', 'brand_id':'31', 'gender_id':'3'},
{'model':'pantera laser', 'brand_id':'31', 'gender_id':'3'},
{'model':'pantera v', 'brand_id':'31', 'gender_id':'3'},
{'model':'dagara', 'brand_id':'31', 'gender_id':'3'},
{'model':'bat', 'brand_id':'31', 'gender_id':'3'},
{'model':'sky laces', 'brand_id':'31', 'gender_id':'3'},
{'model':'sky v', 'brand_id':'31', 'gender_id':'3'},
{'model':'gladiator', 'brand_id':'31', 'gender_id':'3'},
{'model':'pantera soft', 'brand_id':'31', 'gender_id':'3'},
{'model':'pantera', 'brand_id':'31', 'gender_id':'3'},
{'model':'pantera 2.0', 'brand_id':'31', 'gender_id':'3'},
{'model':'pegaso', 'brand_id':'31', 'gender_id':'3'},
]
)
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

0 comments on commit bd22b62

Please sign in to comment.