[sqlalchemy] Re: insert defaults

2010-03-25 Thread patrick
Thanks. I might have figured out a solution. I can get it to assign func.compressed to the column attribute, but I can't get it to load the text uncompressed now. class BaseStruct(object): def _set_text(self, text): self.compressed = func.compress(text) def _get_text(self):

Re: [sqlalchemy] Re: insert defaults

2010-03-25 Thread Michael Bayer
patrick wrote: In the past I assigned Matrix.text=column_property(select([uncompress(compressed)]),deferred=True) I could probably write a little SqlSoup to do this select statement, but is there a way I can integrate this all well? The way I'm doing this feels very sloppy. SqlAlchemy is

[sqlalchemy] Re: insert defaults

2010-03-25 Thread patrick
Yes, but then my descriptor is washed away. I'm trying to make it like a column property on 'get' and a descriptor enabled property on 'set'. On Mar 25, 3:27 pm, Michael Bayer mike...@zzzcomputing.com wrote: patrick wrote: In the past I assigned

Re: [sqlalchemy] Re: insert defaults

2010-03-25 Thread Michael Bayer
patrick wrote: Yes, but then my descriptor is washed away. I'm trying to make it like a column property on 'get' and a descriptor enabled property on 'set'. here's an example of a full round trip of data going in through a func.() and out through a func.() - use this recipe: from sqlalchemy

[sqlalchemy] Re: insert defaults

2010-03-05 Thread patrick
Well it's something between the two. The instance variable compressed will always be NULL when adding or updating an instance, but I want it to infer a value from another instance variable. When inserting... the value of 'compressed' in the sql statement needs to be the raw SQL string

Re: [sqlalchemy] Re: insert defaults

2010-03-05 Thread Michael Bayer
On Mar 5, 2010, at 6:44 PM, patrick wrote: Well it's something between the two. The instance variable compressed will always be NULL when adding or updating an instance, but I want it to infer a value from another instance variable. When inserting... the value of 'compressed' in the sql