Created
December 15, 2017 08:26
-
-
Save cezar77/236e47f5ff361bcbbc29e1727a03b298 to your computer and use it in GitHub Desktop.
Break long lines in Python without using backslash (SO question 47808863)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| orders = Order.objects.filter( | |
| adjustments__type='payment', | |
| adjustments__location__isnull=False, | |
| status__gte=200, | |
| status__lt=300 | |
| ).exclude( | |
| adjustments__location__zipcode__in=['', '0000', '00000', 0000, 00000] | |
| ).values( | |
| # 'id', | |
| 'adjustments__location__city', | |
| 'adjustments__location__state', | |
| 'adjustments__location__country' | |
| ).annotate( | |
| bookings=Count('amount'), #, distinct=True), | |
| total_booking_value=Sum('amount'), | |
| average_booking_value=Avg('amount') | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment