2007年07月02日 星期一 11:34
ÎÒÏëÖªµÀËûµÄORMÉú³ÉµÄSQLÊÇʲô?? Èç: Entry.objects.all()[5:10] ÎÒÏëÖªµÀËûÊÇÓÃSQL ʵÏÖµÄOFFSET 5 LIMIT 5,»¹ÊǼǵÃÈ«È¡»Øºó,ÔÚÊý×éÖÐʵÏÖµÄ. Homepage: http://www.netkiller.org.cn -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070702/6d05bf83/attachment.htm -------------- 下一部分 -------------- Ò»¸ö·ÇÎı¾¸½¼þ±»Çå³ý... ·¢ÐÅÈË: %(who)s Ö÷Ìâ: %(subject)s ÈÕÆÚ: %(date)s ´óС: 1325 Url: http://python.cn/pipermail/python-chinese/attachments/20070702/6d05bf83/attachment.bin
2007年07月02日 星期一 17:16
最简单的方法是 在Python25\Lib\site-packages\django\db\models\query.py中的第181句后面加入: print "SELECT " + (self._distinct and "DISTINCT " or "") + ",".join(select) + sql, params 这样,每次执行数据库操作,都能在控制台中看到SQL语句 不过,会出好多的,眼睛会疼一点:) 在07-7-2,Neo Chen <openunix at 163.com> 写道: > > 我想知道他的ORM生成的SQL是什么?? > > 如: > Entry.objects.all()[5:10] > > 我想知道他是用SQL 实现的OFFSET 5 LIMIT 5,还是记得全取回后,在数组中实现的. > > Homepage: http://www.netkiller.org.cn > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070702/11ba4e55/attachment.htm
2007年07月02日 星期一 19:27
django.db.connection.queries On 7/2/07, Neo Chen <openunix at 163.com> wrote: > > 我想知道他的ORM生成的SQL是什么?? > > 如: > Entry.objects.all()[5:10] > > 我想知道他是用SQL 实现的OFFSET 5 LIMIT 5,还是记得全取回后,在数组中实现的. > > Homepage: http://www.netkiller.org.cn > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -- http://codeplayer.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070702/8fd4cdb8/attachment.htm
2007年07月03日 星期二 10:41
Äĸö¿ØÖÆ̨ѽ?ÈçºÎÅäż .... ÔÚ07-7-2£¬ÌìÌìÏòÉÏ <tiananlw在gmail.com> дµÀ£º > > ×î¼òµ¥µÄ·½·¨ÊÇ ÔÚPython25\Lib\site-packages\django\db\models\query.pyÖеĵÚ181¾äºóÃæ¼ÓÈ룺 > print "SELECT " + (self._distinct and "DISTINCT " or "") + > ",".join(select) + sql, params > ÕâÑù£¬Ã¿´ÎÖ´ÐÐÊý¾Ý¿â²Ù×÷£¬¶¼ÄÜÔÚ¿ØÖÆ̨Öп´µ½SQLÓï¾ä > > ²»¹ý£¬»á³öºÃ¶àµÄ£¬ÑÛ¾¦»áÌÛÒ»µã£º£© > > > > ÔÚ07-7-2£¬Neo Chen <openunix在163.com> дµÀ£º > > > > ÎÒÏëÖªµÀËûµÄORMÉú³ÉµÄSQLÊÇʲô?? > > > > Èç: > > Entry.objects.all()[5:10] > > > > ÎÒÏëÖªµÀËûÊÇÓÃSQL ʵÏÖµÄOFFSET 5 LIMIT 5,»¹ÊǼǵÃÈ«È¡»Øºó,ÔÚÊý×éÖÐʵÏÖµÄ. > > > > Homepage: http://www.netkiller.org.cn > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070703/09b8da82/attachment-0001.html
2007年07月03日 星期二 11:22
manualÉÏ˵¹ýµÄ¡£ ²»¹ý²»¼ÇµÃÔÚÄÄÕÂÁË¡£ On 7/3/07, haur <hekun06在gmail.com> wrote: > > Äĸö¿ØÖÆ̨ѽ?ÈçºÎÅäż .... > > ÔÚ07-7-2£¬ÌìÌìÏòÉÏ <tiananlw在gmail.com> дµÀ£º > > > > ×î¼òµ¥µÄ·½·¨ÊÇ > > ÔÚPython25\Lib\site-packages\django\db\models\query.pyÖеĵÚ181¾äºóÃæ¼ÓÈ룺 > > print "SELECT " + (self._distinct and "DISTINCT " or "") + > > ",".join(select) + sql, params > > ÕâÑù£¬Ã¿´ÎÖ´ÐÐÊý¾Ý¿â²Ù×÷£¬¶¼ÄÜÔÚ¿ØÖÆ̨Öп´µ½SQLÓï¾ä > > > > ²»¹ý£¬»á³öºÃ¶àµÄ£¬ÑÛ¾¦»áÌÛÒ»µã£º£© > > > > > > > > ÔÚ07-7-2£¬Neo Chen < openunix在163.com> дµÀ£º > > > > > > ÎÒÏëÖªµÀËûµÄORMÉú³ÉµÄSQLÊÇʲô?? > > > > > > Èç: > > > Entry.objects.all()[5:10] > > > > > > ÎÒÏëÖªµÀËûÊÇÓÃSQL ʵÏÖµÄOFFSET 5 LIMIT 5,»¹ÊǼǵÃÈ«È¡»Øºó,ÔÚÊý×éÖÐʵÏÖµÄ. > > > > > > Homepage: http://www.netkiller.org.cn > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070703/60a7eda1/attachment-0001.htm
2007年07月03日 星期二 11:57
On 7/3/07, Tian <askfor在gmail.com> wrote: > manual上说过的。 > 不过不记得在哪章了。 > FAQ -- I like python! UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou
Zeuux © 2025
京ICP备05028076号