答复: Django ORM问题

"Handle.Huang" <[email protected]> Sun, 20 Jan 2008 22:46:42 +0800
Newsgroups gmane.comp.python.chinese
Message-ID <[email protected]>
如果使用默认的模型的话,那一个app就只有一个model.py,如果这个app有很多表的
话,难道所有的表都要定义在这个一个文件中,要是再加上自定义方法,这个文件将会
是很恐怖的,而且结构上也不好啊。

 

PS:

         这个app已经在setting.py中已经定义了

 

发件人: [email protected]
[mailto:[email protected]] 代表 cougar2008
发送时间: 2008年1月20日 22:38
收件人: [email protected]
主题: Re: [python-chinese] Django ORM问题

 

还是跟结构有关系吧,应该按照正常的走吧,要不找不到你的模型定义的地方,所以没
有执行结果吧

 

你 manage.py startapp xxx  试试,改下面的模型

 

  _____  

cougar2008

2008-01-20

  _____  

发件人: Handle.Huang

发送时间: 2008-01-20 21:31:01

收件人: [email protected]

抄送: 

主题: [python-chinese]Django ORM问题

 

在Django中如果用 "python manage.py sqlall urus" 命令创建数据库脚本,但是没有
效果,是否这个命令对目录结构有特殊要求,因为这里我修改了默认的结构,如果在不
修改结构的情况下,要如果做?

 

 

urus

│  urls.py

│  urls.pyc

│  __init__.py

│  __init__.pyc

│

├─models

│      projects.py

│      __init__.py

│      __init__.pyc

│

└─views

        main.py

        main.pyc

        __init__.py

        __init__.pyc_______________________________________________

python-chinese

Post: send [email protected]

Subscribe: send subscribe to [email protected]

Unsubscribe: send unsubscribe to  [email protected]

Detail Info: http://python.cn/mailman/listinfo/python-chinese

_______________________________________________

python-chinese

Post: send [email protected]

Subscribe: send subscribe to [email protected]

Unsubscribe: send unsubscribe to  [email protected]

Detail Info: http://python.cn/mailman/listinfo/python-chinese

_______________________________________________
python-chinese
Post: send [email protected]
Subscribe: send subscribe to [email protected]
Unsubscribe: send unsubscribe to  [email protected]
Detail Info: http://python.cn/mailman/listinfo/python-chinese