Advertisement
MaximCherchuk

switch

Nov 14th, 2018
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. from waffle.models import Switch
  2.  
  3.  
  4. class Job:
  5.  
  6.     def execute(self, backwards=False):
  7.         if backwards:
  8.             return self.backwards_func()
  9.         else:
  10.             return self.forwards_func()
  11.  
  12.     def forwards_func(self):
  13.         profile_service_receiver_switch, created = (
  14.             Switch.objects.get_or_create(name='switch_name')
  15.         )
  16.  
  17.     def backwards_func(self):
  18.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement