New field type with custom sql conversion
Bro are you high? Do you english? my phone apparently autocorrected a bunch...nice way to build a community.... This might help: https://github.com/coleifer/peewee/blob/master/tests/fields.py#L1134-L1167 For those running across this, I extrapolated from the link above. The fix is:
```
r = Select(None, [fn.ST_X(value).alias('x'), fn.ST_Y(value).alias('y')]).first(self.model._meta.database)
return r['x'], r['y']
``` I would not recommend that, as it implies a query for every value. I'm not sure where or in what context you are executing this additional query.

It'd be better to, whenever selecting from this field, to do the conversion automatically. This is where the `db_value()` method comes into play, which is somewhat exemplified in the code I linked. I may have a misunderstanding of what `db_value()` is doing. I thought that it converted values for storing in the database? And `python_value()` converted database values to python values? I'm doing the above in `python_value()` as the representation of the geometry column as returned by SELECT is WKB. The appropriate SELECT to get the components of the field would be something like `SELECT ST_X(bbox),ST_Y(bbox) FROM tablename;` which returns 2 entries for a single column. What you're doing is super inefficient, is what I'm saying. If you run a query that returns 100 rows, you're sending off 100 *additional* queries. Nobody should do this, it's terrible advice and inefficient.

Another route is to modify your select so that you grab the values explicitly:

```python

query = MyModel.select(
    MyModel, 
    fn.ST_X(MyModel.bbox).alias('bbox_x'),
    fn.ST_Y(MyModel.bbox).alias('bbox_y'))
``` I understand that it's inefficient, I'm trying to figure out how to make the ORM do it in a single select and automatically populate the object. The context is something like:
`
class Bar(Model):
  id = IntegerField(primary_key=True)

class Foo(Model):
  bbox = BoxField()  # this is the custom field with the bbox accessor
  bar = ForeignKey(Bar, backref="foo")

# ...
tmp = Bar.get(id=my_bar_id)
json.dumps(model_to_dict(tmp))
I'm using trunk and some coffee I had running with the latest 2.x from pypi is no longer working. I'm implementing a Field for postgis point geometry. My conversation function to python used
```
q=SelectQuery(self.model_type, fn.ST_X(value).alias('x'), fn.ST_Y(value).alias('y'))
r=q.first_row()
return r.x, r.y
```
I can't get your working now. Is there an equivalent? Or a better way? If prefer to have the initial select do the conversation instead of a second select query.