Re: Special SELECT and UPDATE for a field

2013-01-31 Thread Yarden Sachs
In the end, what i did is, i added a conversion type to MySQLDB for my Corrdinates object to convert it to a non literal string. and for the selecting part, i had to copy and alter db/sql/compiler's get_columns and get_default_columns to wrap my field selection with the AsText function. a very

Re: Special SELECT and UPDATE for a field

2013-01-31 Thread Yarden Sachs
You can see in my paste that i already created a custom field for geometry field. On Thu, Jan 31, 2013 at 7:52 PM, Tom Evans wrote: > On Wed, Jan 30, 2013 at 8:14 PM, Yarden Sachs wrote: > > Hello, > > i want to create a field class for geometry

Re: Special SELECT and UPDATE for a field

2013-01-31 Thread Tom Evans
On Wed, Jan 30, 2013 at 8:14 PM, Yarden Sachs wrote: > Hello, > i want to create a field class for geometry (not using geodjango). > here's the field code: http://pastebin.com/yADpZykJ > > i want 2 things i can't seem to do: > 1. I want the select to wrap the column with MySql

Re: Special SELECT and UPDATE for a field

2013-01-31 Thread Yarden Sachs
Its a hack. but it solves the save problem: class CoordinatesQuerySetManager(models.Manager): def __getattr__(self, name): return getattr(self.get_query_set(), name) def get_query_set(self): q = self.model.QuerySet(self.model) connection =

Special SELECT and UPDATE for a field

2013-01-30 Thread Yarden Sachs
Hello, i want to create a field class for geometry (not using geodjango). here's the field code: http://pastebin.com/yADpZykJ i want 2 things i can't seem to do: 1. I want the select to wrap the column with MySql AsText() Function e.x. SELECT AsText(location) FROM addresses 2. I want to be able