On Feb 5, 9:16 am, "Arnar Birgisson" <[EMAIL PROTECTED]> wrote:
> I think the point of having an ORM is to have a bridge between a rdbms
> and your objects so that you can utilize the best from both worlds. If
> the "recommended" SO way is simply not to use the database except for
> storing some bytes - why even bother with a RDMBS, cPickle is much
> simpler and faster.
>
> And yes, I'm not being serious. But I don't see why this would ever be
> considered "the ORM way" of doing things. ORM is not the same as an
> object database - it's just (as the name implies) a mapper.
The "best of both worlds" is Dejavu in this case. Instead of:
Person.select(LIKE(func.LOWER(Person.q.name), "%%%s%%" %
name.lower())))
...or:
[x for x in SOClass.select() if x.lastname.find('smith.') >= 0]
...Dejavu allows you to write:
recall(Person, lambda x: "Smith" in x.name)
...or, if you really, truly wanted a case-insensitive search:
recall(Person, lambda x: dejavu.icontains(x.name, "Smith"))
...either of which will generate a LIKE clause for you. They also will
automatically use native LOWER functions when needed, and will correct
for the fact that LIKE is already case-insensitive in MS SQL Server.
Robert Brewer
System Architect
Amor Ministries
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---