Hello,
what would be the best way to perform a search against columns of a
table ? I have the following code that works fine:
pattern = %bla%
client_list = self.query.select(or_(model.Client.c.name.like(pattern),
model.Client.c.contact.like(pattern), model.Client.c.email.like(pattern)))
On 11/6/06, percious [EMAIL PROTECTED] wrote:
I think I have reached the limit of what activemapper can do for me!
Consider the following example:
class Alarm(ActiveMapper):
class mapping:
__table__ = Alarm
alarmID = column(Integer, primary_key=True)
On Nov 6, 4:29 am, Alexandre CONRAD [EMAIL PROTECTED] wrote:
Hello,
what would be the best way to perform a search against columns of a
table ? I have the following code that works fine:
pattern = %bla%
client_list = self.query.select(or_(model.Client.c.name.like(pattern),
hey, no, youre doing great, breaking new ground yourself. i havent
spent much time with inheritance scenarios other than what you see in
the examples and unittests (and a lot of that other people came up
with). just as long as the rowsets contain the information, things
are good. this is also
Am Montag, den 06.11.2006, 16:15 + schrieb Dennis:
SELECT clients.name AS clients_name, clients.contact AS clients_contact,
clients.email AS clients_email, clients.id_client AS clients_id_client
FROM clients
WHERE clients.name LIKE %s OR clients.contact LIKE %s OR clients.email
LIKE
I'm having difficulty with table joins not using my foreign keys. A
corrected query would produce modules.module_id =
module_extra_keys.module_id in the WHERE clause. But in the below
test code, it does not. However, if I use the get_by() function of the
data_mapper the SQL is correct.
dmiller wrote:
Is there a reason why this doesn't work:
orders = Table('orders', meta,
Column('id', Integer, Sequence('order_id_seq'), primary_key=True),
...
)
items = Table('items', meta,
Column('id', Integer, Sequence('item_id_seq'), primary_key=True),
On Nov 6, 2006, at 3:31 PM, Randall Smith wrote:
dmiller wrote:
Is there a reason why this doesn't work:
...
order = session.query(Order).get(1) # assume order exists
itemsNotInOrder = session.query(Item).select(Item.c.order != order) #
ERROR!
This should work.
itemsNotInOrder =
sqlite hasnt been tested with that particular configurational change
(never knew it was possible, and it seems like it may not be working
completely). however, SA will by default have nothing to do with
unicode, if you arent using convert_unicode or any Unicode column
types. encoding does
the c namespace is only for table columns. if we wanted a namespace
that had represented mapper properties, which is not just column-mapped
attributes but relationships as well, that would be something else
altogether. we'd have to define a whole package of expression objects
that represent
if youre adding ClauseElements to select_by, all the automatic
joining logic does not take effect for those.
By ClauseElement, i mean when you say:
select_by(someclass.c.somecol == 'somevalue')
the == operation produces a new object called a ClauseElement, and is
passed to the select_by
11 matches
Mail list logo