0

我正在尝试创建新的表单字段类型,其中包含多个输入,但它转换为我实体中的组合数据..

实体

我想在我的事件实体中保存两个字段:

  1. location<spatial point>
  2. gmap_data<json>

形式

我需要创建 3 个包含 gmaps 数据的输入。

问题

  1. 如何创建实际上具有 3 个输入字段的表单字段类型?
  2. 如何创建将这 3 个字段转换为实体需求的 DataTransformer?(从 3 个输入字段到 orm 字段:地理空间点和 json)?
4

1 回答 1

0

for all of you who interesting in the solution:

  1. Create 3 AbstractType: myformType GmapType GeolocationType

  2. Create 2 transformers GeolocationTransformer - transform Point() to string LocationTransformer - transform gmap to geolocation string

  3. Placing gmap and geolocation in myformType

于 2013-07-06T21:22:54.050 回答