Ejemplo n.º 1
0
def task_post(request, get_header=None):

    if request.method == "POST":
        if all_in_request(request.POST, ("task-type", "task-repeat-frequency", "task-assign-model")):
            __queryDataSet = request.POST
            __task_type_id = __queryDataSet["task-type"]
            __task_repeat_freq = __queryDataSet["task-repeat-frequency"]
            __task_assign_model = __queryDataSet["task-assign-model"]
            task_type = Task_Type.objects.get(id=__task_type_id)
            return wrapped_render_to_response(
                "task/post.html",
                {
                    "IS_POSTBACK": True,
                    "HEADER_MENU": get_header(session=request.session),
                    "IS_LOGINED": get_is_logined(request),
                    "TASK_TYPE": task_type,
                    "REQUEST": {"task_repeat_freq": __task_repeat_freq, "task_assign_model": __task_assign_model},
                },
            )
        else:
            return HttpResponse("wrong#")

    else:
        return wrapped_render_to_response(
            "task/post.html",
            {
                "IS_POSTBACK": False,
                "HEADER_MENU": get_header(session=request.session),
                "IS_LOGINED": get_is_logined(request),
                "TASK_TYPE": Task_Type.objects.get(id=3),  # 默认任务类型为其他
            },
        )
Ejemplo n.º 2
0
def task_post_review(request, get_header=None):

    task = Task()
    task.title = request.POST["task_title"]
    task.describe = request.POST["task_describe"]
    task.private_describe = request.POST["task_private_describe"]
    task.price = request.POST["task_price"]
    task.helper_payment = request.POST["task_helper_payment"]
    task.task_type = Task_Type.objects.get(id=request.POST["task_type"])
    task.private_describe = request.POST["task_private_describe"]
    task.done_with_virtual = request.POST["done_with_virtual"]
    task.need_vehicle = request.POST["need_vehicle"]

    return wrapped_render_to_response(
        "task/post_review.html", {"HEADER_MENU": get_header(session=request.session), "TASK": task}
    )