fastadmin icon indicating copy to clipboard operation
fastadmin copied to clipboard

CRUD is not working

Open OzodbekUSTECH opened this issue 1 year ago • 0 comments

I gotta problem with crud of a model. Help please. I cant even create user (

class Book(BaseTable):
    __tablename__ = "books"

    title: Mapped[str]
    description: Mapped[str] = mapped_column(Text) 
    
  

@register(Book, sqlalchemy_sessionmaker=session_maker)
class BookAdmin(SqlAlchemyModelAdmin):
    list_display = ("id", "title")
    list_display_links = ("id", "title")
    list_filter = ("id", "title")
    search_fields = ("title",)
Details

2023-11-16 19:50:58,448 INFO sqlalchemy.engine.Engine BEGIN (implicit) INFO:sqlalchemy.engine.Engine:BEGIN (implicit) 2023-11-16 19:50:58,449 INFO sqlalchemy.engine.Engine SELECT "user".username AS user_username, "user".hash_password AS user_hash_password, "user".is_superuser AS user_is_superuser, "user".is_active AS user_is_active, "user".id AS user_id, "user".created_at AS user_created_at, "user".updated_at AS user_updated_at FROM "user" WHERE "user".id = $1::INTEGER INFO:sqlalchemy.engine.Engine:SELECT "user".username AS user_username, "user".hash_password AS user_hash_password, "user".is_superuser AS user_is_superuser, "user".is_active AS user_is_active, "user".id AS user_id, "user".created_at AS user_created_at, "user".updated_at AS user_updated_at FROM "user" WHERE "user".id = $1::INTEGER 2023-11-16 19:50:58,450 INFO sqlalchemy.engine.Engine [cached since 0.02185s ago] (1,) INFO:sqlalchemy.engine.Engine:[cached since 0.02185s ago] (1,) 2023-11-16 19:50:58,451 INFO sqlalchemy.engine.Engine ROLLBACK INFO:sqlalchemy.engine.Engine:ROLLBACK c:\Users\naimo\OneDrive\Рабочий стол\fast-admin.venv\Lib\site-packages\pydantic\type_adapter.py:314: UserWarning: Pydantic serializer warnings: Expected list[str] but got tuple - serialized value may not be as expected Expected list[tuple[nullable, dict[str, json-or-python[json=list[str], python=list[str]]]]] but got tuple - serialized value may not be as expected Expected list[str] but got tuple - serialized value may not be as expected Expected list[tuple[nullable, dict[str, json-or-python[json=list[str], python=list[str]]]]] but got tuple - serialized value may not be as expected return self.serializer.to_python(

OzodbekUSTECH avatar Nov 16 '23 14:11 OzodbekUSTECH