본문 바로가기

hanbin.dev

검색하기
hanbin.dev
프로필사진 hanbindev

  • 분류 전체보기 (54)
    • AWS (6)
    • 객체 지향 (2)
    • 겪었던 오류 (8)
    • Django (2)
    • Network (3)
    • 코딩테스트 (12)
    • Python (6)
    • Docker (1)
    • DB (4)
Guestbook
Today
Total
Notice
Recent Posts
Recent Comments
Link
  • my github
«   2025/05   »
일 월 화 수 목 금 토
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
Tags
  • Spring
  • DB
  • 갓재석
  • classmethod
  • TypeError: 'property' object is not iterable
  • classproperty
  • javascript
  • docker-compose
  • 2차 코딩테스트
  • AWS S3
  • springboot 3.0.0
  • Django
  • github
  • python
  • docker
  • EC2
  • depends_on
  • depends
  • MySQL server on 'db' (115)
  • 프로그래머스
  • AWS
  • S3
  • 우아한 테크코스 2차 합격
  • METACLASS
  • github skyline
  • 코딩테스트
  • python all testcode
  • 재귀함수가 뭔가요
  • OperationalError
  • 우아한테크코스 2차
more
Archives
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록classmethod (1)

hanbin.dev

TypeError: 'property' object is not iterable

import peewee class MySQLModel(peewee.Model): @property @classmethod def unique_fields(cls) -> list: for field_name in cls._meta.fields.keys(): field = getattr(cls, field_name) if field.unique == True or field.primary_key == True: yield field peewee 모델의 unique한 field의 이름을 iterable한 객체로 반환하는 property 함수를 만들었다. key in [field.name for field in MySQLModel.unique_fields] 그런데 위와 같이 사용 할 때 TypeError: &..

Python 2021. 6. 2. 13:38
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바