assert문을 알게 된 계기 def get_queryset(self): """ Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using `self.queryset`. This method should always be used rather than accessing `self.queryset` directly, as `self.queryset` gets evaluated only once, and those results are cached for all subsequent requests. You may want to override this if you need to pr..
@property란? 자바에서의 getter라고 이해하면 편하다 . 그럼 setter는 어떻게 표현하는가? @property를 표시한 함수의 이름 뒤에 .setter를 붙이자. 참고:https://hamait.tistory.com/827 파이썬에서 @property 에 대해 알아보자. @property 이야기 private 와 public 파이썬에서는 클래스 캡슐화에 필요한 접근지정자를 잘 안쓰는 편이다. 어떤 부분에서는 public 을 권장하는 느낌도 든다. public 이 훨씬 편하니깐~ㅎㅎ (예를들어 시 hamait.tistory.com
isinstance를 궁금하게 된 계기는 drf views.py를 조사하게 된 것이 계기였다. def exception_handler(exc, context): """ Returns the response that should be used for any given exception. By default we handle the REST framework `APIException`, and also Django's built-in `Http404` and `PermissionDenied` exceptions. Any unhandled exceptions may return `None`, which will cause a 500 error to be raised. """ if isinstance(exc, ..

1. 가상환경 설정 및 장고 설치 #가상환경 설정 python3 -m venv venv #가상환경 ON source ./venv/bin/activate #django 설치 pip install django #프로젝트 설치 django-admin startproject batch . 도커환경에 맞게 구현하기 위해 해당 디렉터리 구조를 변경하였다. 2. django settings.py #장고 프로젝트 내의 시간을 한국 시간으로 설정 LANGUAGE_CODE = 'ko' TIME_ZONE = 'Asia/Seoul' USE_I18N = True USE_L10N = True USE_TZ = True # celery와 관련된 환경설정 CELERY_BROKER_URL = 'redis://redis:6379/0' C..
적용 문제: https://leetcode.com/problems/merge-intervals/ Merge Intervals - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. 문제에 적용하기 해당 문제를 풀었을 때 정렬 안하고 풀었더니 다음과 같은 테스트 케이스에서 막혔었다. Input: [[1,4],[0,4]] Output: [[1,4]] Expected: [[0,4]] 그래서 해당 input을 먼저 정렬한 다음에 솔루션을 적용해보기로 했다. 우선 저는 ..
1. error 해결법 setattr로 해결하기 사용법 setattr(obj,key,value) 만일 독자가 obj[key]=value 형식으로 했는데 제목과 같은 에러가 난다면 위와 같이 "setattr"로 해결해보는 것도 좋은 판단이다. 참고: https://stackoverflow.com/questions/8542343/object-does-not-support-item-assignment-error Object does not support item assignment error In my views.py I assign values before saving the form. I used to do it the following way: projectForm.lat = session_results..
- Total
- Today
- Yesterday
- Celery
- docker
- dockerignore
- 카카오
- PostgreSQL
- headers
- Command Line
- 2021 KAKAO BLIND RECRUITMENT
- 파이썬
- Python
- thread
- 알고리즘
- Pattern
- Collections
- docker-compose
- Spring
- 프로그래머스
- postgres
- 그래프
- env
- 자바
- DRF
- setattr
- django
- Linux
- ubuntu
- 면접
- BFS
- 백준
- Java
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |