daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Item.objects.filter(serial__in=license_ids).update(renewable=not F('renewable'))
  2.    
  3. from django.db.models import Case, Value, When
  4.  
  5. Item.objects.filter(serial__in=license_ids
  6. ).update(renewable=Case(
  7.     When(renewable=True, then=Value(False)),
  8.     default=Value(True))
  9.     )
  10. )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top