티스토리 뷰
반응형
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['lat'] projectForm.lng = session_results['lng'] Now, since the list of
stackoverflow.com
반응형
'파이썬 > 장고' 카테고리의 다른 글
[drf][viewset] @action (0) | 2021.08.04 |
---|---|
[django][celery][celery-beat][flower] docker를 통한 django와 celery 연동!! (2) | 2021.08.03 |
Docker-compose를 통한 Django + Nginx + Postgres 작업 [.dockerignore] [docker-compose 환경변수/env 파일 처리하기] (0) | 2021.07.21 |
django testcase 작성시 headers 작성 방법 (1) | 2021.07.10 |
django testcase user create (0) | 2021.07.09 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 알고리즘
- Pattern
- Collections
- 자바
- docker-compose
- thread
- dockerignore
- headers
- DRF
- docker
- setattr
- 카카오
- Java
- Python
- PostgreSQL
- 백준
- 면접
- django
- ubuntu
- 프로그래머스
- 파이썬
- Celery
- Command Line
- postgres
- BFS
- 2021 KAKAO BLIND RECRUITMENT
- 그래프
- env
- Spring
- Linux
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
글 보관함