Django
åæ¸ã åèãªã³ã¯ ç°å¢ äºåæºå: ã¢ãã«ã®ä½æã¨ãã¼ã¿æå ¥ No.0 çºè¡ãããSQLã確èªãã No.1 select_relatedã§è¦ªãåã No.2 select_relatedã§è¦ªã®è¦ªãåã No.3 prefetch_relatedã§è¤æ°ä»¶ã®å¤ãåã No.4 Prefetchãªãã¸ã§ã¯ãã§å¤ãfilter No.5 prefeâ¦
åæ¸ã ç°å¢ åèãªã³ã¯ ãã³ãã¬ã¼ãã®ä½æã®åºæ¬æé ãã³ãã¬ã¼ãããã¸ã§ã¯ãã®ç«ã¡ä¸ã ããã¸ã§ã¯ãã®æ§æå¤æ´ ããã¸ã§ã¯ãåããã¬ã¼ã¹ãã«ãã¼ã«å¤æ æ¦è¦ ä¸æã§å¤æããã¹ã¯ãªãã ãã³ãã¬ã¼ãããã¨ã«æ°è¦ããã¸ã§ã¯ãä½æ æ¹æ³ config以å¤ã®åâ¦
åæ¸ã ææ è²ã®å¤æ´ get_colorsã¡ã½ãã get_dataset_optionsã¡ã½ãã optionså±æ§ã®ä»å è£è¶³: å©ç¨å¯è½ãªview åæ¸ã æè¿ãæ¥åã§Django + Chart.jsã使ã£ãã·ã¹ãã ãä½æãã¾ããã Chart.jsã¯ç¶ºéºãªã°ã©ããç°¡åã«ä½æãããã¨ãã§ããã¾ãããã¥ã¡â¦
使ãåãã«ã¤ãã¦ã®çµè« (æå¾ã®èå¯ã§è©³ããã¾ã¨ãã¦ãã¾ãã) ãã¡ã¤ã«ãµã¤ãºãå°ããæ§ãªããHttpResponseã使ãã Djangoã§å·¨å¤§ãªãã¡ã¤ã«ãä½æããéã«ã¯ãStreamingHttpResponseã使ããããããªãããããå¯è½ãªéãé¿ããæ¹ããããCSVåºåã¯Djangoâ¦
åæ¸ã ç°å¢,ãã¼ã«ã®ãã¼ã¸ã§ã³ 使ç¨ãããã¼ã« ä»æ§ã¨å®è£ æ¹é ããã¸ã§ã¯ãã®ä½æã¨ã¤ã³ã¹ãã¼ã« DataTablesã§ã®è¡¨ç¤º(Server-side processing) DataTablesãµã¼ãã¼ãµã¤ãå¦çã®å®è£ PDFåºå ä½è«: DataTablesã®PDFåºåæ©è½ ãµã¼ãã¼ãµã¤ã: WeasyPrintãâ¦
åæ¸ã åèã«ããã¦ããã ãããªã³ã¯ Amazon Linuxã®ç«ã¡ä¸ã å¿ è¦ãªã©ã¤ãã©ãªã®ã¤ã³ã¹ãã¼ã« åæºå WeasyPrintãåããããã®æºå å¿ è¦ãªã³ã¼ãã®ä½æã¨PDFåºå PDFãåºåããViewã¨Templates ç¢ºèª æååãã¸ã®å¯¾å¿ æ¥æ¬èªãã©ã³ãã®ã¤ã³ã¹ãã¼ã« ãã©â¦
DRFã«ã¯ãä¾å¤(Exception)ãResponseã®å½¢ã§è¿ãä»çµã¿ãåãã£ã¦ãã¾ãããã®å人çãªãã¼ãã§ãã ããããã㨠æ¬è¨äºã§ã®å種ãã¡ã¤ã« ã«ã¹ã¿ã å¦çãæããã¨ãã§ããå ´æ (1) ã¨ã©ã¼ããç´æ¥ã¬ã¹ãã³ã¹ãä½ã (2) æ¢åããããã¯ä½æããä¾å¤ãraiseãâ¦