FastAPI-Amis-Admin is a high-performance, efficient and easily extensible FastAPI admin framework. Inspired by django-admin, and has as many powerful functions as django-admin.
class Base(DeclarativeBase):
__abstract__ = True
id = Column(UUID(as_uuid=True), primary_key=True, index=True, unique=True, server_default=text("gen_random_uuid()"))
class User(Base):
__tablename__ = "users"
__pydantic_model__ = UserSchema
class UserAdmin(ModelAdmin):
model = User
When i register this UserAdmin class i am able to view list of users in admin screen, but I can not update them, I get an exception:
hex = hex.replace('urn:', '').replace('uuid:', '')
AttributeError: 'UUID' object has no attribute 'replace'
For me it seems that function get_python_type_parse which is used in SqlalchemyCrud class does not handle UUID type, and in method _fetch_item_scalars it tries to pass UUID instance into UUID class
can you resolve this issue by adding UUID handler to get_python_type_parse ?
I have the next model
When i register this UserAdmin class i am able to view list of users in admin screen, but I can not update them, I get an exception:
For me it seems that function
get_python_type_parse
which is used inSqlalchemyCrud
class does not handle UUID type, and in method_fetch_item_scalars
it tries to pass UUID instance into UUID classcan you resolve this issue by adding UUID handler to get_python_type_parse ?