本文整理汇总了Python中field.Field.getid方法的典型用法代码示例。如果您正苦于以下问题:Python Field.getid方法的具体用法?Python Field.getid怎么用?Python Field.getid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类field.Field
的用法示例。
在下文中一共展示了Field.getid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: postsimilar
# 需要导入模块: from field import Field [as 别名]
# 或者: from field.Field import getid [as 别名]
def postsimilar(self,sessionuserid):
newf = []
for fld in self.fields:
f = Field(sessionuserid,fld.decoration,fld.label)
newf.append(f)
cPickle.dump(f, open(f.getid()+".obj",'wb'))
newp = Pagelet(sessionuserid,self.views,newf)
self.leaves.append(newp.getid())
cPickle.dump(self, open(self.getid()+".obj",'wb'))
cPickle.dump(self, open(newp.getid()+".obj",'wb'))
return newp
示例2: open
# 需要导入模块: from field import Field [as 别名]
# 或者: from field.Field import getid [as 别名]
stud_grp.adduser(u2.getid())
cPickle.dump(stud_grp, open(stud_grp.getid()+".obj",'wb'))
teach_grp = Group ("Teachers")
teach_grp.adduser(u3.getid())
teach_grp.adduser(u4.getid())
cPickle.dump(teach_grp, open(teach_grp.getid()+".obj", 'wb'))
#****************************************************************************************
# Session user is the teacher now
#****************************************************************************************
sessionuser = u3
print "\nNow you are the teacher 1"
# Instantiating fields
q1 = Field(sessionuser.getid(),{"format":"textbox"},"Sin(30)=")
cPickle.dump(q1, open(q1.getid()+".obj", 'wb'))
q2 = Field(sessionuser.getid(),{"format":"textbox"},"Cos(30)=")
cPickle.dump(q2, open(q2.getid()+".obj", 'wb'))
g = Field(sessionuser.getid(),{"format":"textbox"},"Grade=")
cPickle.dump(g, open(g.getid()+".obj", 'wb'))
# Instantiating Views
qp_perm = Permissions({stud_grp.getid():{q1.getlabel():"-w",q2.getlabel():"-w",g.getlabel():"--"},\
teach_grp.getid():{q1.getlabel():"r-",q2.getlabel():"r-",g.getlabel():"--"}})
qpaper = ViewCategory(sessionuser.getid(),"qpaper",qp_perm,workflow)
gp_perm = Permissions({stud_grp.getid():{q1.getlabel():"rn",q2.getlabel():"rn",g.getlabel():"r-"},\
teach_grp.getid():{q1.getlabel():"r-",q2.getlabel():"r-",g.getlabel():"rw"}})