On Oct 17, 2006, at 1:46 PM, Christoph Zwerschke wrote:

>
> The problem is that when I request the user 'fred' with
> get_by(name='fred'), and it is stored as 'Fred' in the database, it  
> will
> still not be found, because name is a synonym for _name which is the
> original column. Any suggestion how to solve this?
>

we can get some support for things like that by adding a callable  
argument to synonym() which does an in-python translation of the  
value.  but that is starting to get ugly, and also starts to have  
redundancy (i.e. more than one way to do it) vs. using a  
MapperExtension which can override select_by (and should probably  
allow get_by and others to be overridden as well).  0.3 is going to  
have a cleaner way to add extensions onto Query for things like this.

the question is, do you ever want that whitespace in the application  
space ?  you might want to just create a custom String subclass that  
converts the whitespace in and out at the Table level.  that would be  
cleaner.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sqlalchemy
-~----------~----~----~----~------~----~------~--~---

Reply via email to