데이터2 [Django] View 안에서 데이터 모델 특정 갯수만 가져오는 방법 1. 다음과 같이 뷰(View.py) 파일을 작성하세요. # 특정 앱(appName)의 데이터 모델(ModelName) 로딩 from appName.models import ModelName def function(request): # 인스턴스 생성 # 데이터 모델의 필드명('id')을 선택 # 원하는 갯수([:3] = 3개)만큼 쿼리셋 로딩 instance = ModelName.objects.all().order_by('id')[:3] # 'key':value 형태로 데이터 전달 context = { 'instance':instance, } return render(request, '~.html', context) 결과는 instance 라는 이름의 인스턴스에 3개의 쿼리셋이 담겨옵니다. 데이터를 가져.. 2019. 10. 17. [파일 복구/Wise Data Recovery] Shift+Delete 로 삭제한 파일/폴더 복구하기 (무료) "본 글은 '2019-09-24' 최초 작성 되었으며, 업데이트 발생 시 글 내용이 수정될 수 있음을 미리 알려드림" 들어가며... 작성자는 회사 업무 도중 [Ctrl + C], [Ctrl + V] 를 가지고 놀며 장난치다가 복사가 온전히 잘 됐겠지? 하며, 당당하게 필살기 [Shift + Delete] 를 사용하여 1주일 짜리 업무를 삭제하는 만행을 저질렀다. Step 1. WDR setup 파일 설치 https://www.wisecleaner.com/download.html WiseCleaner Downloads - Download Free Registry Cleaner, Download Free Disk Cleaner, Download Wise Care 365 Download Center Wise .. 2019. 9. 26. 이전 1 다음