コード例 #1
0
ファイル: admin.py プロジェクト: mathuin/pyment
 def cancel_one(self, request, order=None):
     if order is not None:
         if cancel_order(order):
             self.message_user(request, 'One order was cancelled!')
         else:
             self.message_user(request, 'No orders were cancelled!')
     else:
         return None
コード例 #2
0
 def cancel_one(self, request, order=None):
     if order is not None:
         if cancel_order(order):
             self.message_user(request, 'One order was cancelled!')
         else:
             self.message_user(request, 'No orders were cancelled!')
     else:
         return None
コード例 #3
0
ファイル: admin.py プロジェクト: mathuin/pyment
 def make_cancelled(self, request, queryset):
     orders_cancelled = 0
     for order in queryset:
         if cancel_order(order):
             orders_cancelled += 1
     if orders_cancelled == 0:
         self.message_user(request, 'No orders were cancelled!')
     else:
         if orders_cancelled == 1:
             self.message_user(request, 'One order was cancelled!')
         else:
             self.message_user(request, '%d orders were cancelled!' % orders_cancelled)
コード例 #4
0
 def make_cancelled(self, request, queryset):
     orders_cancelled = 0
     for order in queryset:
         if cancel_order(order):
             orders_cancelled += 1
     if orders_cancelled == 0:
         self.message_user(request, 'No orders were cancelled!')
     else:
         if orders_cancelled == 1:
             self.message_user(request, 'One order was cancelled!')
         else:
             self.message_user(request, '%d orders were cancelled!' % orders_cancelled)