Re: POSSIBLE BUG: using Coalesce() with __in=[]

2016-03-30 Thread Ryan Prater
2e0cd26ffb29189add1e0435913fd1490f52b20d/django/db/models/lookups.py#L221-L223 > [2] > https://github.com/django/django/blob/2e0cd26ffb29189add1e0435913fd1490f52b20d/django/db/models/sql/query.py#L439-L445 > > Le mercredi 30 mars 2016 12:27:49 UTC-4, Ryan Prater a écrit : >> >> It seems that using an

Why doesn't {{ form.field.value }} return cleaned data?

2016-03-30 Thread Ryan Prater
Say I have a TypedMultipleChoiceField and I'm building a custom select multiple widget in my template. If I want to check a box based on an initial value (ie. default checked options), OR check a box based on form data that has been returned (ie. error state), I would do this: HOWEVER, {{for

POSSIBLE BUG: using Coalesce() with __in=[]

2016-03-30 Thread Ryan Prater
It seems that using an empty list when using the `__in=` filter prevents an Aggregate Coalesce from working properly. See below: # Test with matched Queryset. Sum will return 50 OrderItem.objects.filter(pk__in=[1]).aggregate(test=Coalesce(Sum('quantity'), Value(0))) >>> {'test': 50} # Test wit