Skip to content

Instantly share code, notes, and snippets.

@moacirmoda
Created May 15, 2019 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moacirmoda/bdec5a1d1980481bf228179a8dd32f1b to your computer and use it in GitHub Desktop.
Save moacirmoda/bdec5a1d1980481bf228179a8dd32f1b to your computer and use it in GitHub Desktop.
from rider.models import *
rides_with_ck_ids = CheckRide.objects.all().values_list('ride_id', flat=True)
rides_ids = Ride.objects.all().values_list('id', flat=True)
rides_without_ck_ids = []
for id in rides_ids:
if id not in rides_with_ck_ids:
rides_without_ck_ids.append(id)
print(rides_without_ck_ids)
rides = Ride.objects.filter(ckride__isnull=True).count()
print([ride.id for ride in rides])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment