Beispiel #1
0
def add_box(request):

    try:
        # フィード登録
        box = Box(
            box_name="新規ボックス",
            user=request.user,
        )
        box.add_box()
    except Exception:
        # ボックスの登録失敗
        return HttpResponseRedirect(reverse('common_error'))

    return HttpResponseRedirect(reverse('common_edit'))
Beispiel #2
0
    def set_default_box(self, request):

        # 現在日時取得
        now = datetime.datetime.now()

        box = Box()
        box.box_name = "デフォルトボックス"
        box.user = request.user
        box.add_box()

        self.user = request.user
        self.default_box = box
        self.create_date = now
        self.updated_date = now
        self.del_flg = False
        self.save()