コード例 #1
0
 def create_childcare_product(self, name='아이돌봄', start_at=None):
     product = TicketProduct(type=TicketProduct.TYPE_CHILD_CARE,
                             name=name,
                             total=3,
                             owner=self.user,
                             price='1000')
     product.is_unique_in_type = False
     product.ticket_open_at = now() - timedelta(days=2)
     product.ticket_close_at = now() + timedelta(days=2)
     product.start_at = start_at if start_at else now() + timedelta(days=14)
     product.finish_at = now() + timedelta(days=14)
     product.cancelable_date = now() + timedelta(days=1)
     product.save()
     return product
コード例 #2
0
 def create_youngcoder_product(self, name='영코더', start_at=None):
     product = TicketProduct(type=TicketProduct.TYPE_YOUNG_CODER,
                             name=name,
                             total=3,
                             owner=self.user,
                             price='1000')
     product.is_unique_in_type = False
     product.ticket_open_at = now() - timedelta(days=2)
     product.ticket_close_at = now() + timedelta(days=2)
     product.start_at = start_at if start_at else now() + timedelta(days=14)
     product.finish_at = now() + timedelta(days=14)
     product.cancelable_date = now() + timedelta(days=1)
     product.save()
     return product