Skip to content

Instantly share code, notes, and snippets.

@moacirmoda

moacirmoda/rides.py

Created May 15, 2019
Embed
What would you like to do?
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
You can’t perform that action at this time.