daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. i = 0
  2. current_pk_set = PredictionRecordModel.objects.filter(transaction_id__isnull=True).values_list("pk", flat=True)[:10000]
  3. while i < 50 and current_pk_set:
  4.     print(i)
  5.     PredictionRecordModel.objects.filter(pk__in=current_pk_set).update(transaction_id=F('yodlee_transaction_id'))
  6.     current_pk_set = PredictionRecordModel.objects.filter(transaction_id__isnull=True).values_list("pk", flat=True)[:10000]
  7.     i += 1  
  8.    
  9. # Post Checks
  10. with_strs = PredictionRecordModel.objects.all().annotate(yod_as_str=Cast('yodlee_transaction_id', CharField()))
  11. assert with_strs.filter(yod_as_str=F('transaction_id')).count() == PredictionRecordModel.objects.all().count()
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