the query in Facility.get_latest_data_by_lga(lga) is slowed down by the for-loop passing things into the defaultdict. (I don't know why, but commenting it out reduced the speed from ~7s down to <1s.) This alternative takes about 1s and produces the same result. (granted, it is ugly, but functionally equivalent except for the date_value problem.)
the query in Facility.get_latest_data_by_lga(lga) is slowed down by the for-loop passing things into the defaultdict. (I don't know why, but commenting it out reduced the speed from ~7s down to <1s.) This alternative takes about 1s and produces the same result. (granted, it is ugly, but functionally equivalent except for the date_value problem.)
jomolinare/kobocat,spatialdev/onadata,SEL-Columbia/nmis,wesley1001/formhub,piqoni/onadata,hnjamba/onaclone,qlands/onadata,awemulya/fieldsight-kobocat,makinacorpus/formhub,mainakibui/kobocat,ehealthafrica-ci/onadata,makinacorpus/formhub,smn/onadata,SEL-Columbia/formhub,makinacorpus/formhub,hnjamba/onaclone,ultimateprogramer/formhub,qlands/onadata,hnjamba/onaclone,eHealthAfrica/formhub,eHealthAfrica/formhub,ultimateprogramer/formhub,ehealthafrica-ci/formhub,ehealthafrica-ci/formhub,jomolinare/kobocat,wesley1001/formhub,GeoODK/onadata,SEL-Columbia/nmis,hnjamba/onaclone,SEL-Columbia/formhub,piqoni/onadata,mainakibui/kobocat,ultimateprogramer/formhub,GeoODK/onadata,awemulya/fieldsight-kobocat,spatialdev/onadata,SEL-Columbia/formhub,SEL-Columbia/nmis,wesley1001/formhub,eHealthAfrica/onadata,kobotoolbox/kobocat,kobotoolbox/kobocat,GeoODK/formhub,SEL-Columbia/nmis,eHealthAfrica/onadata,ehealthafrica-ci/formhub,SEL-Columbia/nmis,piqoni/onadata,spatialdev/onadata,GeoODK/formhub,ultimateprogramer/formhub,awemulya/fieldsight-kobocat,SEL-Columbia/nmis,kobotoolbox/kobocat,qlands/onadata,GeoODK/formhub,ehealthafrica-ci/onadata,sounay/flaminggo-test,wesley1001/formhub,awemulya/fieldsight-kobocat,eHealthAfrica/formhub,eHealthAfrica/formhub,ehealthafrica-ci/onadata,eHealthAfrica/onadata,smn/onadata,GeoODK/onadata,smn/onadata,smn/onadata,mainakibui/kobocat,jomolinare/kobocat,mainakibui/kobocat,jomolinare/kobocat,piqoni/onadata,GeoODK/onadata,spatialdev/onadata,kobotoolbox/kobocat,sounay/flaminggo-test,SEL-Columbia/formhub,sounay/flaminggo-test,qlands/onadata,ehealthafrica-ci/onadata,sounay/flaminggo-test,ehealthafrica-ci/formhub,makinacorpus/formhub