Home
Sign Up
Sign In
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member
Sign In
›
Remote Worker
V2EX
›
Project Babel
读代码遇到一些疑问,求解
linsk
·
Aug 17, 2011
· 6688 views
This topic created in 5366 days ago, the information mentioned may be changed or developed.
https://github.com/livid/v2ex/blob/master/topic.py#L1118
#1130~1134行
q = db.GqlQuery("SELECT * FROM Reply WHERE num = :1", int(reply_num))
if q[0]:
reply = q[0]
topic = reply.topic
node = topic.node
#问1134行 为什么不需要先在数据库中获得?因为整个topic对象都存储在reply.topic中吗?
Topic
Reply
num
2 replies
•
1970-01-01 08:00:00 +08:00
1
Weakdancer
Aug 17, 2011
https://github.com/livid/v2ex/blob/master/v2ex/babel/__init__.py#L175
Livid 用了Google提供的 ReferenceProperty
http://code.google.com/intl/zh-CN/appengine/docs/python/datastore/typesandpropertyclasses.html#ReferenceProperty
2
linsk
OP
Aug 17, 2011
@
Weakdancer
感谢你花费的5分钟,很大帮助
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
1259 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms ·
UTC 23:57
·
PVG 07:57
·
LAX 16:57
·
JFK 19:57
♥ Do have faith in what you're doing.
❯