1 Oct 00:15
Query using ends with
From: Leandro Sales <leandroal <at> gmail.com>
Subject: Query using ends with
Newsgroups: gmane.comp.python.sqlobject
Date: 2008-09-30 22:19:23 GMT
Subject: Query using ends with
Newsgroups: gmane.comp.python.sqlobject
Date: 2008-09-30 22:19:23 GMT
Hello. Please consider the following: I have a sqlobject object named
Domain that stores the list of available domains:
class Domain(SQLObject):
name = StringCol(alternateID=True, length=255, default=None)
In the database I have domains like:
ID name
--------------------------
1 domain1.com
2 domain2.com
I'd like to query the domain into the database that contains in a
given hostname, lets say "www.domain1.com".
I now that I can do something like:
domain = Domain.select(Domain.q.name.endswith("www.domain1.com"))
but instead, I'd check which domain name is in the hostname. Somethink like:
domain = Domain.select("www.domain1.com".endswith(Domain.q.name.endswith()))
.. but sqlobject doesn't allow me to do this. Any clue?
Thank you,
Leandro.
-------------------------------------------------------------------------
(Continue reading)



RSS Feed