我正在尝试创建新的表单字段类型,其中包含多个输入,但它转换为我实体中的组合数据..
实体
我想在我的事件实体中保存两个字段:
location<spatial point>
gmap_data<json>
形式
我需要创建 3 个包含 gmaps 数据的输入。
问题
- 如何创建实际上具有 3 个输入字段的表单字段类型?
- 如何创建将这 3 个字段转换为实体需求的 DataTransformer?(从 3 个输入字段到 orm 字段:地理空间点和 json)?
我正在尝试创建新的表单字段类型,其中包含多个输入,但它转换为我实体中的组合数据..
我想在我的事件实体中保存两个字段:
location<spatial point>
gmap_data<json>
我需要创建 3 个包含 gmaps 数据的输入。
for all of you who interesting in the solution:
Create 3 AbstractType:
myformType
GmapType
GeolocationType
Create 2 transformers
GeolocationTransformer
- transform Point() to string
LocationTransformer
- transform gmap to geolocation string
Placing gmap and geolocation in myformType