Example #1
0
def search(request):
    if request.method == "GET":
        boards = Board.objects.all().order_by('-id')
        q = request.GET.get('q', "")
        if q:
            board = boards.filter(title_incontains=q)
            return render()
        context = {"boards": boards}
        context.update(is_active(request.session))
        return render(request, "board/search.html", context)
Example #2
0
def add(request):
    board_title = request.POST['title']
    board_detail = request.POST['detail']
    if 'fileInput' in request.POST.keys():
        file = None
    else:
        file = request.FILES['fileInput']
    user_name = request.session['user_id']
    board_count = 0
    board_create_date = datetime.datetime.now()
    board_update_date = datetime.datetime.now()
    board_user = User.objects.get(user_id=request.session['user_id'])
    board_user_name = request.session['user_name']
    board = Board(title=board_title,
                  detail=board_detail,
                  count=board_count,
                  create_date=board_create_date,
                  update_date=board_update_date,
                  user_id=board_user,
                  user_name=board_user_name,
                  attachment=file)
    board.save()
    grant = is_active(request.session)
    return redirect('/board/paging/1')
Example #3
0
def paging(request, tableid):
    Table = Board.objects.all().order_by('-id')
    paging = Paginator(Table, 10)
    context = {"Table": paging.page(tableid)}
    context.update(is_active(request.session))
    return render(request, "board/paging.html", context)
Example #4
0
def index(request):
    boards = Board.objects.all().order_by('-id')
    context = {"boards": boards}
    context.update(is_active(request.session))
    return render(request, "board/index.html", context)
Example #5
0
def index(request):
    context = is_active(request.session)
    return render(request, 'picture/index.html', context)
Example #6
0
def pandas(request):
    qs = User.objects.all().values()
    df = pd.DataFrame(qs)
    print(df)
    context = {"is_active": is_active(request.session), "pandas": df.to_html()}
    return render(request, 'portfolio/pandas.html', context)
Example #7
0
def beacon_video(request):
    context = is_active(request.session)
    return render(request, 'portfolio/beacon_video.html', context)
Example #8
0
def career(request):
    context = is_active(request.session)
    return render(request, 'portfolio/career.html', context)