- 이진트리
- 완전검색
- distinct
- SQL
- N:1
- M:N
- 쟝고
- count
- 그리디
- regexp
- Tree
- 뷰
- Vue
- 큐
- 스택
- 트리
- ORM
- drf
- Article & User
- migrations
- Queue
- 통계학
- outer join
- delete
- DB
- 백트래킹
- stack
- update
- create
- Django
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
목록Read (2)
데이터 분석 기술 블로그
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/b3lHKI/btsGSQ23YUo/VihP4O3vK66VRwbZoGJVk0/img.png)
1. 게시글 READ 각 게시글의 작성자 이름을 출력한다. {% for article in articles %} 작성자 : {{ article.user }} 글 번호 : {{ article.pk }} 글 제목 : {{article.title }} 글 내용: {{ article.content }} {% endfor %} 2. 게시글 UPDATE 게시글 수정 요청 사용자와 게시글 작성 사용자를 비교하여 보인의 게시글만 수정할 수 있도록 합니다. # articles/views.py @login_required def update(request, pk): article = Article.objects.get(pk=pk) if request.user == article.user: if request.method ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/b7RcvF/btsGdEQkr4n/dDlRgfXQTwvdT51IuF5tW0/img.png)
1. Read 1-1 전체 게시글 조회 # articles/views.py from .models import Article def index(request): articles = Article.objects.all() context = { 'articles': articles, } return render(request, 'articles/index.html', context) Articles {% for article in articles %} 글 번호: {{ article.pk }} 글 제목: {{article.title }} 글 내용: {{article.content }} {% endfor %} 1-2. 단일 게시글 조회 # articles/urls.py urlpatterns = [ ... pat..