- SQL
- 트리
- regexp
- count
- create
- M:N
- update
- 쟝고
- Vue
- stack
- drf
- outer join
- Django
- 큐
- 그리디
- 이진트리
- distinct
- N:1
- migrations
- 통계학
- Article & User
- Tree
- 백트래킹
- ORM
- delete
- 완전검색
- Queue
- 스택
- DB
- 뷰
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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)
데이터 분석 기술 블로그

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 ..

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..