当前位置: 首页>>代码示例>>Python>>正文


Python Record.objects方法代码示例

本文整理汇总了Python中models.Record.objects方法的典型用法代码示例。如果您正苦于以下问题:Python Record.objects方法的具体用法?Python Record.objects怎么用?Python Record.objects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Record的用法示例。


在下文中一共展示了Record.objects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: time_step2

# 需要导入模块: from models import Record [as 别名]
# 或者: from models.Record import objects [as 别名]
def time_step2(request):
    _ip = request.POST["IP"]
    _time_step2 = request.POST["Time_step2"]

    try:
        record = Record.objects(ip=_ip)
    except DoesNotExist:
        return HttpResponse(status=400)
    record.time_step2 = str(_time_step2)
    record.save()
开发者ID:noobxinyu,项目名称:lionet_fyp,代码行数:12,代码来源:views.py

示例2: new_user

# 需要导入模块: from models import Record [as 别名]
# 或者: from models.Record import objects [as 别名]
def new_user(request):
    _ip = request.POST["IP"]
    _name = request.POST["Name"]
    _gender = request.POST["Gender"]
    _age = request.POST["Age"]
    _occupation = request.POST["Occupation"]
    _email = request.POST["Email"]

    try:
        record = Record.objects(ip=_ip)
    except DoesNotExist:
        return HttpResponse(status=400)
    record.name = str(_name)
    record.gender = str(_gender)
    record.age = int(_age)
    record.occupation = str(_occupation)
    record.email = str(_email)
    record.save()
开发者ID:noobxinyu,项目名称:lionet_fyp,代码行数:20,代码来源:views.py

示例3: check_ip

# 需要导入模块: from models import Record [as 别名]
# 或者: from models.Record import objects [as 别名]
def check_ip(request):
    try:
        exp = Exp.objects(onlyKey=1)
    except DoesNotExist:
        exp = Exp()
        exp.save()

    _ip = request.POST["IP"]
    try:
        record = Record.objects(ip=_ip)
    except DoesNotExist:
        exp.count += 1
        exp.save()
        record = Record(ip=_ip, seqNo=exp.count)
        record.save()

    if record.time_end is None:
        return HttpResponse(status=200)
    else:
        return HttpResponse(status=400)
开发者ID:noobxinyu,项目名称:lionet_fyp,代码行数:22,代码来源:views.py

示例4: questionnaire

# 需要导入模块: from models import Record [as 别名]
# 或者: from models.Record import objects [as 别名]
def questionnaire(request):
    _ip = request.POST["IP"]
    _question1 = request.POST["question1"]
    _question2 = request.POST["question2"]
    _question3 = request.POST["question3"]
    _question4 = request.POST["question4"]
    _question5 = request.POST["question5"]
    _question6 = request.POST["question6"]
    _question7 = request.POST["question7"]
    _question8a = request.POST["question8a"]
    _question8b = request.POST["question8b"]
    _question8c = request.POST["question8c"]
    _question8d = request.POST["question8d"]
    _question8e = request.POST["question8e"]
    _question8f = request.POST["question8f"]
    _question9a = request.POST["question9a"]
    _question9b = request.POST["question9b"]
    _question9c = request.POST["question9c"]
    _question9d = request.POST["question9d"]
    _question10 = request.POST["question10"]
    _question11 = request.POST["question11"]
    _question12 = request.POST["question12"]
    _question13 = request.POST["question13"]
    _question14 = request.POST["question14"]
    _question15 = request.POST["question15"]
    _question16 = request.POST["question16"]
    _question17 = request.POST["question17"]
    _question18 = request.POST["question18"]
    _question19 = request.POST["question19"]
    _question20 = request.POST["question20"]
    _question21 = request.POST["question21"]
    _question22 = request.POST["question22"]
    _question23 = request.POST["question23"]
    _question24 = request.POST["question24"]
    _question25 = request.POST["question25"]
    _question26 = request.POST["question26"]
    _question27 = request.POST["question27"]
    _question28 = request.POST["question28"]
    _habit1 = request.POST["habit1"]
    _habit2 = request.POST["habit2"]
    _time_end = request.POST["Time_end"]

    try:
        record = Record.objects(ip=_ip)
    except DoesNotExist:
        return HttpResponse(status=400)
    record.question.append(str(_question1))
    record.question.append(str(_question2))
    record.question.append(str(_question3))
    record.question.append(str(_question4))
    record.question.append(str(_question5))
    record.question.append(str(_question6))
    record.question.append(str(_question7))
    record.question.append(str(_question8a))
    record.question.append(str(_question8b))
    record.question.append(str(_question8c))
    record.question.append(str(_question8d))
    record.question.append(str(_question8e))
    record.question.append(str(_question8f))
    record.question.append(str(_question9a))
    record.question.append(str(_question9b))
    record.question.append(str(_question9c))
    record.question.append(str(_question9d))
    record.question.append(str(_question10))
    record.question.append(str(_question11))
    record.question.append(str(_question12))
    record.question.append(str(_question13))
    record.question.append(str(_question14))
    record.question.append(str(_question15))
    record.question.append(str(_question16))
    record.question.append(str(_question17))
    record.question.append(str(_question18))
    record.question.append(str(_question19))
    record.question.append(str(_question20))
    record.question.append(str(_question21))
    record.question.append(str(_question22))
    record.question.append(str(_question23))
    record.question.append(str(_question24))
    record.question.append(str(_question25))
    record.question.append(str(_question26))
    record.question.append(str(_question27))
    record.question.append(str(_question28))
    record.question.append(str(_habit1))
    record.question.append(str(_habit2))

    record.time_end = str(_time_end)
    record.save()
开发者ID:noobxinyu,项目名称:lionet_fyp,代码行数:89,代码来源:views.py


注:本文中的models.Record.objects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。