本文整理汇总了Python中models.List.select方法的典型用法代码示例。如果您正苦于以下问题:Python List.select方法的具体用法?Python List.select怎么用?Python List.select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.List
的用法示例。
在下文中一共展示了List.select方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: index
# 需要导入模块: from models import List [as 别名]
# 或者: from models.List import select [as 别名]
def index(password):
print >> sys.stderr, "within index"
try:
if password == PASSWORD:
print >> sys.stderr, "within try"
sellerList = Seller.select()
smsList = SMS.select()
numberList = Number.select()
l = List.select()
marketList = Market.select()
lrList = ListRelationship.select()
outboxList = Outbox.select()
return render_template("index.html", title = 'TABLES', sellerList = sellerList, smsList = smsList, l = l, marketList = marketList)
#return 'hello world'
else:
print >> sys.stderr, "wrong password"
except:
print >> sys.stderr, "within except"
print >> sys.stderr, str(sys.exc_info()[0]) # These write the nature of the error
print >> sys.stderr, str(sys.exc_info()[1])
statement = 'An exception has Occured'+ str(sys.exc_type) + '[' + str(sys.exc_value) + ']'
return statement
示例2: get_Mini_Sellers_ListNames
# 需要导入模块: from models import List [as 别名]
# 或者: from models.List import select [as 别名]
def get_Mini_Sellers_ListNames(seller):
sellersListNames = []
for l in List.select().where(List.seller == seller):
sellersListNames.append(l.name)
return sellersListNames
示例3: check_List_Exists
# 需要导入模块: from models import List [as 别名]
# 或者: from models.List import select [as 别名]
def check_List_Exists(listName):
for l in List.select():
if listName == List.name:
print 'this list exists!'
return True
示例4: check_Mini_Sellers_ListName_Exists
# 需要导入模块: from models import List [as 别名]
# 或者: from models.List import select [as 别名]
def check_Mini_Sellers_ListName_Exists(seller, name):
for l in List.select():
if l.seller == seller and l.name == name:
print 'seller already created this list!'
return True
示例5: Task
# 需要导入模块: from models import List [as 别名]
# 或者: from models.List import select [as 别名]
import datetime
from models import Board, List, Task
highest_order = Task.select().where(Task.belongs_to_list == 1).order_by(Task.task_order.desc()).get()
new_task = Task(
belongs_to_list=List.select().where(List.name == "Important List"),
task_name="Learn Rails",
task_description="I am trying to learn rails so I can build complex apps in the future and also my own api someday.",
task_order=(highest_order.task_order + 1),
)
new_task.save()