[Python/FastAPI/ODMantic] TypeError: field Config is defined without type annotation

2024. 6. 19. 15:55·Minding's Programming/에러 코드
728x90
반응형

인프런의 '파이썬 동시성 프로그래밍 : 데이터 수집부터 웹 개발까지 (feat. FastAPI)' 강의를 수강하다가 발생한 에러코드.

서버를 실행할 때 마다 위와 같은 에러가 발생했다.

https://art049.github.io/odmantic/modeling/

 

Modeling - ODMantic

Modeling Models To create a Model, simply inherit from the Model class and then specify the field types and eventually their descriptors. Collection Each Model will be linked to its own collection. By default, the collection name will be created from the c

art049.github.io

공식 문서를 확인해보니, 강의 코드 버전과 다르게 odmantic의 모델링 코드가 변경된 듯하다.

 

# book.py

# 강의에 나오는 코드
class Config:
    collection = "books"

# 수정한 코드
model_config = {"collection": "books"}

Config 클래스를 없애고 아래와 같이 코드를 수정했다.

728x90

'Minding's Programming > 에러 코드' 카테고리의 다른 글

SQLAlchemy QueuePool 에러 해결하기 (sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30.00)  (0) 2025.03.20
Python 프로그래밍 중 가장 많이 발생하는 5가지 에러코드 정리  (0) 2023.08.08
ModuleNotFoundError: No module named 'sklearn.utils.linear_assignment_'  (0) 2021.04.01
[에러코드/DeepSort] KeyError: "The name 'net/images:0' refers to a Tensor which does not exist. The operation, 'net/images', does not exist in the graph."  (0) 2021.04.01
AttributeError: module 'tensorflow' has no attribute 'gfile'  (0) 2021.04.01
'Minding's Programming/에러 코드' 카테고리의 다른 글
  • SQLAlchemy QueuePool 에러 해결하기 (sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30.00)
  • Python 프로그래밍 중 가장 많이 발생하는 5가지 에러코드 정리
  • ModuleNotFoundError: No module named 'sklearn.utils.linear_assignment_'
  • [에러코드/DeepSort] KeyError: "The name 'net/images:0' refers to a Tensor which does not exist. The operation, 'net/images', does not exist in the graph."
Minding
Minding
  • Minding
    Today's Minding
    Minding
  • 전체
    오늘
    어제
    • 울고넘는 딥러닝 (278)
      • Minding's Baseball (57)
        • MLB Statcast (29)
        • 머신러닝으로 홈런왕 예측하기 (3)
        • 야구칼럼 (12)
        • 야구 규칙, 용어 (1)
        • 2022-23 질롱 코리아 (8)
        • 류현진 등판경기 (4)
      • Minding's Programming (185)
        • 프로그래머스 코딩테스트 (21)
        • Knowledge (44)
        • Numpy & Pandas (6)
        • Excel (3)
        • Git (1)
        • Pygame (11)
        • CV (3)
        • Tensorflow tutorial (4)
        • Kaggle and Dacon (4)
        • 에러 코드 (8)
        • FastAPI (8)
        • Airflow (29)
        • Crawling (6)
        • Django (14)
        • AWS (18)
        • Spark (5)
      • Minding's Reading (30)
        • 머신러닝 딥러닝에 필요한 기초 수학 with 파이.. (2)
        • 칼만필터는 어렵지 않아 (11)
        • 밑바닥부터 시작하는 딥러닝 (6)
        • 메이저리그 야구 통계학 2e (8)
        • 논문읽기 (2)
        • 빅데이터를 지탱하는 기술 (1)
      • Minding's Life (5)
        • 주식 (4)
        • 각종 소식 (1)
  • 블로그 메뉴

    • 홈
    • Baseball
    • Programming
    • Reading
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    django python
    AWS
    프로그래머스
    데이터 엔지니어
    파이썬
    데이터분석
    MLB
    메이저리그
    pygame
    mlb stats api
    칼만필터는어렵지않아python
    코딩테스트
    칼만필터
    칼만필터는어렵지않아
    머신러닝
    KalmanFilter
    django
    딥러닝
    파이썬게임개발
    게임개발
    야구
    에어플로우
    질롱코리아
    넘파이
    Python
    파이게임
    칼만필터는어렵지않아파이썬
    Airflow
    FastAPI
    KBO
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
Minding
[Python/FastAPI/ODMantic] TypeError: field Config is defined without type annotation

개인정보

  • 티스토리 홈
  • 포럼
  • 로그인
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.