本文整理汇总了Python中addons.models.AddonUpsell.text方法的典型用法代码示例。如果您正苦于以下问题:Python AddonUpsell.text方法的具体用法?Python AddonUpsell.text怎么用?Python AddonUpsell.text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addons.models.AddonUpsell
的用法示例。
在下文中一共展示了AddonUpsell.text方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save
# 需要导入模块: from addons.models import AddonUpsell [as 别名]
# 或者: from addons.models.AddonUpsell import text [as 别名]
def save(self):
if 'paypal_id' in self.cleaned_data:
self.addon.paypal_id = self.cleaned_data['paypal_id']
self.addon.support_email = self.cleaned_data['support_email']
self.addon.save()
if 'price' in self.cleaned_data:
premium = self.addon.premium
if not premium:
premium = AddonPremium()
premium.addon = self.addon
premium.price = self.cleaned_data['price']
premium.save()
upsell = self.addon.upsold
if (self.cleaned_data['do_upsell'] and
self.cleaned_data['text'] and self.cleaned_data['free']):
if not upsell:
upsell = AddonUpsell(premium=self.addon)
upsell.text = self.cleaned_data['text']
upsell.free = self.cleaned_data['free']
upsell.save()
elif not self.cleaned_data['do_upsell'] and upsell:
upsell.delete()
示例2: save
# 需要导入模块: from addons.models import AddonUpsell [as 别名]
# 或者: from addons.models.AddonUpsell import text [as 别名]
def save(self):
if 'paypal_id' in self.cleaned_data:
self.addon.paypal_id = self.cleaned_data['paypal_id']
self.addon.support_email = self.cleaned_data['support_email']
self.addon.save()
if 'price' in self.cleaned_data:
premium = self.addon.premium
if not premium:
premium = AddonPremium()
premium.addon = self.addon
premium.price = self.cleaned_data['price']
premium.save()
upsell = self.addon.upsold
if (self.cleaned_data['do_upsell'] and
self.cleaned_data['text'] and self.cleaned_data['free']):
# Check if this app was already a premium version for another app.
if upsell and upsell.free != self.cleaned_data['free']:
upsell.delete()
if not upsell:
upsell = AddonUpsell(premium=self.addon)
upsell.text = self.cleaned_data['text']
upsell.free = self.cleaned_data['free']
upsell.save()
elif not self.cleaned_data['do_upsell'] and upsell:
upsell.delete()
示例3: save
# 需要导入模块: from addons.models import AddonUpsell [as 别名]
# 或者: from addons.models.AddonUpsell import text [as 别名]
def save(self):
if 'price' in self.cleaned_data:
premium = self.addon.premium
if not premium:
premium = AddonPremium()
premium.addon = self.addon
premium.price = self.cleaned_data['price']
premium.save()
upsell = self.addon.upsold
if (self.cleaned_data['do_upsell'] and
self.cleaned_data['text'] and self.cleaned_data['free']):
# Check if this app was already a premium version for another app.
if upsell and upsell.free != self.cleaned_data['free']:
upsell.delete()
if not upsell:
upsell = AddonUpsell(premium=self.addon)
upsell.text = self.cleaned_data['text']
upsell.free = self.cleaned_data['free']
upsell.save()
elif not self.cleaned_data['do_upsell'] and upsell:
upsell.delete()
self.addon.premium_type = self.cleaned_data['premium_type']
self.addon.support_email = self.cleaned_data['support_email']
self.addon.save()
# If they checked later in the wizard and then decided they want
# to keep it free, push to pending.
if (not self.addon.paypal_id and self.addon.is_incomplete()
and not self.addon.needs_paypal()):
self.addon.mark_done()
示例4: save
# 需要导入模块: from addons.models import AddonUpsell [as 别名]
# 或者: from addons.models.AddonUpsell import text [as 别名]
def save(self):
if "paypal_id" in self.cleaned_data:
self.addon.paypal_id = self.cleaned_data["paypal_id"]
self.addon.support_email = self.cleaned_data["support_email"]
self.addon.save()
if "price" in self.cleaned_data:
premium = self.addon.premium
if not premium:
premium = AddonPremium()
premium.addon = self.addon
premium.price = self.cleaned_data["price"]
premium.save()
upsell = self.addon.upsold
if self.cleaned_data["do_upsell"] and self.cleaned_data["text"] and self.cleaned_data["free"]:
# Check if this app was already a premium version for another app.
if upsell and upsell.free != self.cleaned_data["free"]:
upsell.delete()
if not upsell:
upsell = AddonUpsell(premium=self.addon)
upsell.text = self.cleaned_data["text"]
upsell.free = self.cleaned_data["free"]
upsell.save()
elif not self.cleaned_data["do_upsell"] and upsell:
upsell.delete()
示例5: save
# 需要导入模块: from addons.models import AddonUpsell [as 别名]
# 或者: from addons.models.AddonUpsell import text [as 别名]
def save(self):
if self.cleaned_data['paypal_id']:
if (self.addon.paypal_id
and self.addon.paypal_id != self.cleaned_data['paypal_id']
and self.addon.premium
and self.addon.premium.paypal_permissions_token):
# If a user changes their paypal id, then we need
# to nuke the token.
self.addon.premium.paypal_permissions_token = ''
self.addon.premium.save()
self.addon.paypal_id = self.cleaned_data['paypal_id']
self.addon.support_email = self.cleaned_data['support_email']
self.addon.save()
if self.cleaned_data['price']:
premium = self.addon.premium
if not premium:
premium = AddonPremium()
premium.addon = self.addon
premium.price = self.cleaned_data['price']
premium.save()
upsell = self.addon.upsold
if (self.cleaned_data['do_upsell'] and
self.cleaned_data['text'] and self.cleaned_data['free']):
if not upsell:
upsell = AddonUpsell(premium=self.addon)
upsell.text = self.cleaned_data['text']
upsell.free = self.cleaned_data['free']
upsell.save()
elif not self.cleaned_data['do_upsell'] and upsell:
upsell.delete()
示例6: save
# 需要导入模块: from addons.models import AddonUpsell [as 别名]
# 或者: from addons.models.AddonUpsell import text [as 别名]
def save(self):
if 'price' in self.cleaned_data:
premium = self.addon.premium
if not premium:
premium = AddonPremium()
premium.addon = self.addon
premium.price = self.cleaned_data['price']
premium.save()
upsell = self.addon.upsold
if (self.cleaned_data['do_upsell'] and
self.cleaned_data['text'] and self.cleaned_data['free']):
# Check if this app was already a premium version for another app.
if upsell and upsell.free != self.cleaned_data['free']:
upsell.delete()
if not upsell:
upsell = AddonUpsell(premium=self.addon)
upsell.text = self.cleaned_data['text']
upsell.free = self.cleaned_data['free']
upsell.save()
elif not self.cleaned_data['do_upsell'] and upsell:
upsell.delete()
# Check for free -> paid for already public apps.
premium_type = self.cleaned_data['premium_type']
if (self.addon.premium_type == amo.ADDON_FREE and
premium_type in amo.ADDON_PREMIUMS and
self.addon.status == amo.STATUS_PUBLIC):
# Free -> paid for public apps trigger re-review.
log.info(u'[Webapp:%s] (Re-review) Public app, free -> paid.' % (
self.addon))
RereviewQueue.flag(self.addon, amo.LOG.REREVIEW_FREE_TO_PAID)
self.addon.premium_type = premium_type
self.addon.save()
# If they checked later in the wizard and then decided they want
# to keep it free, push to pending.
if (not self.addon.needs_paypal() and self.addon.is_incomplete()):
self.addon.mark_done()