#๐Ÿ”’ List of Pydantic BaseModel inside another BaseModel

9 messages ยท Page 1 of 1 (latest)

blazing epochBOT
#

@upper dove

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

solar vale
#

Can you show the full traceback

upper dove
# solar vale Can you show the full traceback
(.venv) ahmed349@ahmed-pc:~/Desktop/money-50k$ python -m backend.app
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/ahmed349/Desktop/money-50k/backend/app.py", line 9, in <module>
    from .blueprints.hospital.imports import imports_bp 
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ahmed349/Desktop/money-50k/backend/blueprints/hospital/imports.py", line 12, in <module>
    class ImportModel(BaseModel):
  File "/home/ahmed349/Desktop/money-50k/backend/blueprints/hospital/imports.py", line 16, in ImportModel
    ingredients : List[Dict[str : Any]] 
                       ~~~~^^^^^^^^^^^
  File "/usr/lib/python3.12/typing.py", line 398, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/typing.py", line 1455, in __getitem__
    _check_generic(self, params, self._nparams)
  File "/home/ahmed349/Desktop/money-50k/backend/.venv/lib/python3.12/site-packages/typing_extensions.py", line 3079, in _check_generic
    raise TypeError(f"Too {'many' if alen > elen else 'few'} arguments"
TypeError: Too few arguments for typing.Dict; actual 1, expected 2```
#

(i am making an api in flask)

#

ah

#

quite a dumbass i am

#

i am working with a team in live share, so uh, oops

blazing epochBOT
#
Python help channel closed using Discord native close action

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.