2007年02月07日 星期三 16:02
ÎÒµÄͨÓÃPhoto modelΪ£º class Photo(models.Model): title = models.CharField(maxlength=128) remark = models.TextField(null=True) photo = models.ImageField(upload_to='pics/%y/%m') photo_type = models.ForeignKey(ContentType) object_id = models.IntegerField() photo_object = models.GenericForeignKey() votes = models.IntegerField(blank=False, default=0) level = models.IntegerField(blank=False, default=0) School Model: class School(models.Model): name = models.CharField(maxlength=128, unique=True) category = models.IntegerField(blank = False) cache = models.IntegerField(default=0) inventor = models.ForeignKey(User) inventor_ip = models.IPAddressField(blank=False) photo = models.GenericRelation(Photo) µ±ÎÒÔËÐУº from xuyong.alumni.models import School school = School.objects.get(id = 1) school_photo=school.photo.all() photo = school_photo.filter(level=1) >>photo Traceback (most recent call last): File "", line 1, in ? File "c:\python24\lib\site-packages\Django- 0.95.1-py2.4.egg\django\db\models\q uery.py", line 100, in __len__ return len(self._get_data()) File "c:\python24\lib\site-packages\Django- 0.95.1-py2.4.egg\django\db\models\q uery.py", line 430, in _get_data self._result_cache = list(self.iterator()) File "c:\python24\lib\site-packages\Django- 0.95.1-py2.4.egg\django\db\models\q uery.py", line 171, in iterator select, sql, params = self._get_sql_clause() File "c:\python24\lib\site-packages\Django- 0.95.1-py2.4.egg\django\db\models\q uery.py", line 444, in _get_sql_clause joins2, where2, params2 = self._filters.get_sql(opts) File "c:\python24\lib\site-packages\Django- 0.95.1-py2.4.egg\django\db\models\q uery.py", line 574, in get_sql joins2, where2, params2 = val.get_sql(opts) File "c:\python24\lib\site-packages\Django- 0.95.1-py2.4.egg\django\db\models\q uery.py", line 622, in get_sql return parse_lookup(self.kwargs.items(), opts) File "c:\python24\lib\site-packages\Django- 0.95.1-py2.4.egg\django\db\models\q uery.py", line 734, in parse_lookup joins2, where2, params2 = lookup_inner(path, lookup_type, value, opts, opts. db_table, None) File "c:\python24\lib\site-packages\Django- 0.95.1-py2.4.egg\django\db\models\q uery.py", line 835, in lookup_inner raise TypeError, "Cannot resolve keyword '%s' into field" % name TypeError: Cannot resolve keyword 'content_type' into field һʱ¼ä²»´óÁ˽âÎÊÌâËùÔÚ£¬»¹ÇëÖ¸µã£¡ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070207/c0b37198/attachment.html
2007年02月07日 星期三 16:32
On 2/7/07, 风向标 <vaneoooo在gmail.com> wrote: > 我的通用Photo model为: > > class Photo(models.Model): > title = models.CharField(maxlength=128) > remark = models.TextField(null=True) > photo = models.ImageField(upload_to='pics/%y/%m') > photo_type = models.ForeignKey (ContentType) 这里定义不对,要定义为 content_type > object_id = models.IntegerField() > photo_object = models.GenericForeignKey() > votes = models.IntegerField(blank=False, default=0) > level = models.IntegerField(blank=False, default=0) > -- I like python! UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou
2007年02月21日 星期三 20:54
ÌâÍ⣺ Ç¿°¡£¬¾ÓÈ»°ÑͼƬÎļþ·ÅÔÚÊý¾Ý¿âÖУ¬ÕâÑùºÃô£¿ On 2/7/07, limodou <limodou在gmail.com> wrote: > > On 2/7/07, ·çÏò±ê <vaneoooo在gmail.com> wrote: > > ÎÒµÄͨÓÃPhoto modelΪ£º > > > > class Photo(models.Model): > > title = models.CharField(maxlength=128) > > remark = models.TextField(null=True) > > photo = models.ImageField(upload_to='pics/%y/%m') > > photo_type = models.ForeignKey (ContentType) > > ÕâÀﶨÒå²»¶Ô£¬Òª¶¨ÒåΪ content_type > > > object_id = models.IntegerField() > > photo_object = models.GenericForeignKey() > > votes = models.IntegerField(blank=False, default=0) > > level = models.IntegerField(blank=False, default=0) > > > > -- > I like python! > UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad > My Blog: http://www.donews.net/limodou > _______________________________________________ > 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 -- ÎÒ×ßµ½Ò»¸öÄ°ÉúµÄµØ·½ ¸æËß±ðÈË ÎÒҪȥÁ÷ÀË Å¶£¬ÎÒҪȥÁÆÉË¡¡ http://www.iexper.com/blog/ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070221/a76a1485/attachment.htm
2007年02月21日 星期三 23:03
ÓÐÂ𣿠·¾¶ÔÚÀïÃæ¶øÒÑ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070221/02502e85/attachment.html
2007年02月25日 星期日 14:09
´ó¼ÒÐÂÄêºÃ£¡ ÏÖÔÚÏëʹÓÃapache+python_mode×ö¸öpythonÓ¦Ó㬵«ÊÇÎÞ·¨Ê¹Óã¬Ò²¾ÍÊÇ˵½âÎö²»ÁË£¬python_mode¿Ï¶¨ÊÇ°²×°ÁË¡£Ôõô»ØÊ°¡£¿ Èç¹ûÎÒÏëÔÚpythonÒ³Ãæµ÷ÓÃlinuxϵͳÃüÁî¸ÃÈçºÎ×ö£¿ÓÖÈçºÎÈÃÃüÁîµÄ·µ»Ø½á¹ûÏÔʾÔÚÎÒµÄpythonÒ³Ã棿лл£¡ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070225/f3adea96/attachment.htm
2007年02月26日 星期一 17:20
¼ÌÐøÇóÖú£¬À´¶¥Ò»Ï£¬Ð»Ð»£¡ ´ó¼ÒÐÂÄêºÃ£¡ ÏÖÔÚÏëʹÓÃapache+python_mode×ö¸öpythonÓ¦Ó㬵«ÊÇÎÞ·¨Ê¹Óã¬Ò²¾ÍÊÇ˵½âÎö²»ÁË£¬python_mode¿Ï¶¨ÊÇ°²×°ÁË¡£Ôõô»ØÊ°¡£¿ Èç¹ûÎÒÏëÔÚpythonÒ³Ãæµ÷ÓÃlinuxϵͳÃüÁî¸ÃÈçºÎ×ö£¿ÓÖÈçºÎÈÃÃüÁîµÄ·µ»Ø½á¹ûÏÔʾÔÚÎÒµÄpythonÒ³Ã棿лл£¡ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070226/b670c066/attachment.html
2007年02月27日 星期二 17:28
On 2/26/07, jsz7758520 <jsz7758520在163.com> wrote: > > ¼ÌÐøÇóÖú£¬À´¶¥Ò»Ï£¬Ð»Ð»£¡ > > ´ó¼ÒÐÂÄêºÃ£¡ > ÏÖÔÚÏëʹÓÃapache+python_mode×ö¸öpythonÓ¦Ó㬵«ÊÇÎÞ·¨Ê¹Óã¬Ò²¾ÍÊÇ˵½âÎö²»ÁË£¬python_mode¿Ï¶¨ÊÇ°²×°ÁË¡£Ôõô»ØÊ°¡£¿ > Èç¹ûÎÒÏëÔÚpythonÒ³Ãæµ÷ÓÃlinuxϵͳÃüÁî¸ÃÈçºÎ×ö£¿ÓÖÈçºÎÈÃÃüÁîµÄ·µ»Ø½á¹ûÏÔʾÔÚÎÒµÄpythonÒ³Ã棿лл£¡ > ûÓÐ˵Çå³þ¡£ Ê×ÏÈÄãÓõÄÊÇ linux/bsd or Windows¡£ Èç¹ûÊÇLINUX£¬ÊÇÄĸö·¢Ðа档 µÚ¶þ£¬ÄãÓÃµÄ apache ÊÇ 1.3.x or 2.0.x or 2.2.x µÚÈý£¬ÄãµÄ python_mode ÊÇ´Ó·¢Ðаü°²×°£¬»¹ÊÇ´ÓÔ´´úÂë±àÒë µÚËÄ£¬½«´íÎóLOGÌù³öÀ´£¬ÕâÑù´ó¼Ò¿ÉÒÔ°ïÄã·ÖÎö -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070227/d794bb6e/attachment.html
2007年02月27日 星期二 17:38
On 2/27/07, Ben Luo <benluo在gmail.com> wrote: > > > > On 2/26/07, jsz7758520 <jsz7758520在163.com> wrote: > > > > 继续求助,来顶一下,谢谢! > > > > 大家新年好! > > > > 现在想使用apache+python_mode做个python应用,但是无法使用,也就是说解析不了,python_mode肯定是安装了。怎么回事啊? > > 如果我想在python页面调用linux系统命令该如何做?又如何让命令的返回结果显示在我的python页面?谢谢! > > > > 没有说清楚。 > 首先你用的是 linux/bsd or Windows。 如果是LINUX,是哪个发行版。 > 第二,你用的 apache 是 1.3.x or 2.0.x or 2.2.x > 第三,你的 python_mode 是从发行包安装,还是从源代码编译 > 第四,将错误LOG贴出来,这样大家可以帮你分析 > > 第五,是python_mode 还是 mod_python? -- simple is good http://brucewang.net skype: number5 -------------- 下一部分 -------------- 一个HTML附件被移除... URL: http://python.cn/pipermail/python-chinese/attachments/20070227/425acc8f/attachment-0001.htm
Zeuux © 2025
京ICP备05028076号