Comments (6)
I can not determine the specific reason, you can set a program breakpoint here to debug, see whether the code is running normally.
from fastapi-amis-admin.
i tried add some event logic, and this requires to set 'id' property for fields because that used to identify field. If not setup id
when copypaste to editor online (to educate logic and properties) editor autogenerate id. So I little confuse id require or not?
async def get_form_item(
self, request: Request, modelfield: ModelField, action: CrudEnum
) -> Union[FormItem, SchemaNode, None]:
item = await super().get_form_item(request, modelfield, action)
if item.name == Trigger.event.key: # noqa
item.id = item.name
if item.name == Trigger.target.key: # noqa
item.id = item.name # noqa
item.selectFirst = True # noqa
item.clearValueOnHidden = True # noqa
item.visibleOn = '${event!="STANDALONE"}'
item.source = {
"url": "TriggerAdmin/target_items/list?tet=${event}",
"sendOn": 'event'
}
return item
maybe just autosetup id field at runtime? i newbe, maybe I'm not right, what you think about this ?
from fastapi-amis-admin.
Are you suggesting that the fastapi-amis-admin source code set an id for form items by default?
from fastapi-amis-admin.
because when insert to editor id autocreate, example:
"id": "u:57b6fb4bc910",
from fastapi-amis-admin.
The default id is not generated for two main reasons:
- I want the json data to be as concise as possible while the core functions are working properly.
- If id is set to name, it is not certain that conflicts will occur if the amis front-end has multiple form components.
from fastapi-amis-admin.
you're right, I think the demo requires a good extending
I will help with this when being possible, I like you library, but so many dark places)))
from fastapi-amis-admin.
Related Issues (20)
- Code Editor not follow Locale settings (and how add support Jinja syntax support?) HOT 1
- ➜ andy pip install fastapi_amis_admin[cli] zsh: no matches found: fastapi_amis_admin[cli] HOT 1
- 如何自定义某个search_fields字段的UI组件 HOT 3
- Passing primary_key is not supported when also passing a sa_column HOT 1
- Using the Simple CRUD Example, Article Creation is not Persisted HOT 3
- can not create data from foreign key HOT 1
- 如何通过点击跳转到新页面? HOT 1
- 如何将ModelAdmin注册到PageAdmin中作为页面的一部分 HOT 1
- qq群还在吗,申请没人同意 HOT 2
- 启动报错AttributeError: secondary
- class BaseApiOut(GenericModel, Generic[_T], BaseApiSchema):TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
- 如何动态切换多语言
- S3 support
- Actions: custom PK (except id) is not passed to ModelAction.handle() HOT 6
- SqlAlchemy model with UUID column does not work properly
- KeyError: 'id'. self.pk: InstrumentedAttribute = self.model.__dict__[self.pk_name]
- The filter on input-group does not work
- "AttributeError: 'AdminSite' object has no attribute 'AnnotatedItemIdList'."
- JSONB, post raise exception
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastapi-amis-admin.