2016-07-01ãã1ã¶æéã®è¨äºä¸è¦§
ModelViewSetãªããã使ç¨ãã¦ããã¨ãããããã®ã¢ã¯ã·ã§ã³æ¯ã«serializerãå¤æ´ããããã¨ãå¤ã ããã¨æãã¾ãã æ¥æ¬èªæ å ±ãå°ãªãã¦ãã¹ããã©ã¯ãã£ã¹ãªã®ãã©ããã¯çãããã§ãããã¯ã©ã¹ãã¼ã¹viewã®ä¸ã§serializerãå¤æ´ããæ¹æ³ãã¨ããããã¡ã¢â¦
ä¸è¨ã®ã³ãã³ãã§ç¡å¹åãã SET FOREIGN_KEY_CHECKS=0; å¿ è¦ãªå¦çãçµäºãããã SET FOREIGN_KEY_CHECKS=1; ããã§å ã«æ»ãã
å¶ç´ã®è¨å®ããããã®ã®ããã¹ããã¼ã¿ã®æå ¥æ®µéã§insertãé»æ¢ãã¦ããéªéãªforeign keyã«æ©ã¾ãããã®ã§ãä¸æçã«åç §æ´åæ§ã®å¶ç´ãåé¤ãã¾ãã ç°å¢ MySQL 5.6 æé ã¾ãã¯ããã¼ãã«ã«è¨å®ããã¦ããåç §å¶ç´ã確èªãã¾ãããã mysql> SHOW CREATEâ¦
å¤æ°ã®ä¸èº«ã®ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ã¯èªåçã«è§£éããã¦ãã¾ãã¾ãã ä¾ãã°ä¸è¨ã®ããã«ãªãã¾ãã >>> s = '1\n2\n3\n' >>> print(s) 1 2 3 å¤æ°ã«å¯¾ãã¦Pythonã®raw stringè¨æ³ã¯ä½¿ç¨ã§ãã¾ããã ããã§reprã使ç¨ããã¨ã >>> print(repr(s)) '1\n2\n3\â¦