Re: Simplifying code with multiple loops and logic, into queryset aggregates

2019-04-30 Thread Joel Mathew
ssion_set__discharged=False, > then=True), default=False).distinct() > > > > > > *From:* django-users@googlegroups.com [mailto: > django-users@googlegroups.com] *On Behalf Of *Joel Mathew > *Sent:* Tuesday, April 30, 2019 9:22 AM > *To:* django-users@googlegroups.com &

RE: Simplifying code with multiple loops and logic, into queryset aggregates

2019-04-30 Thread Matthew Pava
Sent: Tuesday, April 30, 2019 9:22 AM To: django-users@googlegroups.com Subject: Simplifying code with multiple loops and logic, into queryset aggregates My models: class customer(models.Model): cstid = models.AutoField(primary_key=True, unique=True) insurance_number

Simplifying code with multiple loops and logic, into queryset aggregates

2019-04-30 Thread Joel Mathew
My models: class customer(models.Model): cstid = models.AutoField(primary_key=True, unique=True) insurance_number = models.CharField(max_length=100, blank=True, null=True) name = models.CharField(max_length=35) ageyrs = models.IntegerField(blank=True) class Admission(models.Model): id = models.A