예제 #1
0
 def get_all_active_subscriptions(self):
     subscriptions = SubscriptionPlan.gql('WHERE active = True')
     logging.debug('Subsciptions #%s' % subscriptions.count())
     viewable_subscriptions = []
     for subscription in subscriptions:
         viewable_subscriptions.append(
             SubscriptionView(subscription.code, subscription.name,
                              subscription.description))
     return viewable_subscriptions
예제 #2
0
 def get_all_active_subscriptions(self):
     subscriptions = SubscriptionPlan.gql('WHERE active = True')
     logging.debug('Subsciptions #%s' % subscriptions.count())
     viewable_subscriptions = []
     for subscription in subscriptions:
         viewable_subscriptions.append(SubscriptionView(subscription.code, 
                                                        subscription.name, 
                                                        subscription.description))
     return viewable_subscriptions
예제 #3
0
    def add_subscriptions(self):
        plans = SubscriptionPlan.gql("WHERE code = :code",
                                     code=SUBSCRIPTION_PLAN_MONTHLY)
        if plans.count() > 0:
            logging.debug('Subscription %s exists', SUBSCRIPTION_PLAN_MONTHLY)
            return '<html><body>Subscription exists</body></html>'

        subs = SubscriptionPlan()
        subs.code = SUBSCRIPTION_PLAN_MONTHLY
        subs.name = 'Cup of Coffee - Monthly Plan'
        subs.description = 'Unlimited trip creation and report generation every month for the price of a coffee. Try it free for first 15 days. Cancel anytime. No setup fees. No cancellation charges. No hidden fees.'
        subs.active = True
        subs.save()
        logging.debug('Subscription %s added', SUBSCRIPTION_PLAN_MONTHLY)
        return '<html><body>Added subscription</body></html>'
예제 #4
0
파일: setup.py 프로젝트: gselva/tripfiles
 def add_subscriptions(self):
     plans = SubscriptionPlan.gql("WHERE code = :code",
                         code=SUBSCRIPTION_PLAN_MONTHLY)
     if plans.count() > 0:
         logging.debug('Subscription %s exists', SUBSCRIPTION_PLAN_MONTHLY)
         return '<html><body>Subscription exists</body></html>'
     
     subs = SubscriptionPlan()
     subs.code = SUBSCRIPTION_PLAN_MONTHLY
     subs.name = 'Cup of Coffee - Monthly Plan'
     subs.description = 'Unlimited trip creation and report generation every month for the price of a coffee. Try it free for first 15 days. Cancel anytime. No setup fees. No cancellation charges. No hidden fees.'
     subs.active = True
     subs.save()
     logging.debug('Subscription %s added', SUBSCRIPTION_PLAN_MONTHLY)
     return '<html><body>Added subscription</body></html>'