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)
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')
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)
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)
def index(request): context = is_active(request.session) return render(request, 'picture/index.html', context)
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)
def beacon_video(request): context = is_active(request.session) return render(request, 'portfolio/beacon_video.html', context)
def career(request): context = is_active(request.session) return render(request, 'portfolio/career.html', context)