def create_xcty_product(legal_entity_id, code_prefix=''): p = Product(key_name=code_prefix + Product.PRODUCT_EXTRA_CITY) p.price = 1000 p.default_count = 1 p.default = False p.possible_counts = range(1, 37) p.is_subscription = False p.is_subscription_discount = False p.is_subscription_extension = True p.organization_types = [] p.product_dependencies = [ '|'.join([ '%s%s:-1' % (code_prefix, product_code) for product_code in ('MSUP', 'MSSU', 'SSUP', 'SSZP', 'CSUB', Product.PRODUCT_FREE_PRESENCE, Product.PRODUCT_FREE_SUBSCRIPTION) ]) ] p.picture_url = "" p.visible = True p.legal_entity_id = legal_entity_id if code_prefix: p.description_translation_key = p.code[len(code_prefix ):] + '.description' p.default_comment_translation_key = p.code[len(code_prefix ):] + '.default_comment' return p
def create_beac_product(legal_entity_id, code_prefix=''): p = Product(key_name=code_prefix + Product.PRODUCT_BEACON) p.price = 3500 p.default_count = 1 p.default = False p.possible_counts = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] p.is_subscription = False p.is_subscription_discount = False p.organization_types = [] p.product_dependencies = [] p.visible = True p.picture_url = "/static/images/solutions/flex/BEACON_PRESENTATIE.jpg" p.legal_entity_id = legal_entity_id if code_prefix: p.description_translation_key = p.code[len(code_prefix ):] + '.description' p.default_comment_translation_key = p.code[len(code_prefix ):] + '.default_comment' return p
def create_kkrt_product(legal_entity_id, code_prefix=''): p = Product(key_name=code_prefix + Product.PRODUCT_CARDS) p.price = 1750 p.default_count = 2 p.default = False p.possible_counts = range(1, 6) p.is_subscription = False p.is_subscription_extension = False p.organization_types = [] p.product_dependencies = [] p.visible = bool( code_prefix) # only for legal entities other than mobicage p.picture_url = "/static/images/solutions/flex/loyalty_cards.jpg" p.legal_entity_id = legal_entity_id if code_prefix: p.description_translation_key = p.code[len(code_prefix ):] + '.description' p.default_comment_translation_key = p.code[len(code_prefix ):] + '.default_comment' return p
def create_bnnr_product(legal_entity_id, code_prefix=''): p = Product(key_name=code_prefix + Product.PRODUCT_ROLLUP_BANNER) p.price = 10000 p.default_count = 1 p.default = False p.possible_counts = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] p.is_subscription = False p.is_subscription_discount = False p.organization_types = [ServiceProfile.ORGANIZATION_TYPE_CITY] p.product_dependencies = [] p.visible = bool( code_prefix) # only for legal entities other than mobicage p.picture_url = "/static/images/solutions/flex/rollup_banner.jpg" p.legal_entity_id = legal_entity_id if code_prefix: p.description_translation_key = p.code[len(code_prefix ):] + '.description' p.default_comment_translation_key = p.code[len(code_prefix ):] + '.default_comment' return p
def create_posm_product(legal_entity_id, code_prefix=''): p = Product(key_name=code_prefix + Product.PRODUCT_FLYERS) p.price = 6 p.default_count = 250 # 15 euro per 250 p.default = False p.possible_counts = [ 250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500 ] p.is_subscription = False p.is_subscription_discount = False p.organization_types = [] p.product_dependencies = [] p.visible = False p.picture_url = "/static/images/solutions/flex/FLYERS_PRESENTATIE.jpg" p.legal_entity_id = legal_entity_id if code_prefix: p.description_translation_key = p.code[len(code_prefix ):] + '.description' p.default_comment_translation_key = p.code[len(code_prefix ):] + '.default_comment' return p
def create_xctd_product(legal_entity_id, code_prefix=''): p = Product(key_name=code_prefix + 'XCTD') p.price = -1000 p.default_count = 1 p.default = False p.possible_counts = range(1, 37) p.is_subscription = False p.is_subscription_discount = False p.is_subscription_extension = True p.organization_types = [] p.product_dependencies = [ '%(code_prefix)sXCTY:-1' % dict(code_prefix=code_prefix) ] p.picture_url = "" p.visible = True p.legal_entity_id = legal_entity_id p.default_comment_translation_key = '' if code_prefix: p.description_translation_key = p.code[len(code_prefix ):] + '.description' return p
def create_a3ct_product(legal_entity_id, code_prefix=''): p = Product(key_name=code_prefix + Product.PRODUCT_ACTION_3_EXTRA_CITIES) p.price = 2000 p.default_count = 1 p.default = False p.possible_counts = range(1, 37) p.is_subscription = False p.is_subscription_discount = False p.is_subscription_extension = True p.organization_types = [] p.product_dependencies = [ '%(code_prefix)sMSUP:-1|%(code_prefix)sMSSU:-1|%(code_prefix)sSSUP:-1|%(code_prefix)sSSZP:-1|%(code_prefix)sOCAP:-1' % dict(code_prefix=code_prefix) ] p.picture_url = "" p.visible = bool( code_prefix) # only for legal entities other than mobicage p.legal_entity_id = legal_entity_id if code_prefix: p.description_translation_key = p.code[len(code_prefix ):] + '.description' p.default_comment_translation_key = p.code[len(code_prefix ):] + '.default_comment' return p