[sqlalchemy] lower / upper case

2007-04-18 Thread Disrupt07

I have a users table and I want to query the usernames column.  I want
my query to ignore the upper/lower casing.

So the following searches should all match John:  john, jOhn,
johN, JOhn, and so on.

My query at the moment is a follows:
  names = queryselect(users.c.username.startswith(john))

How can I modify the query to obtain the above results?

Thanks


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] sqlalchemy limit by clause

2007-04-17 Thread Disrupt07

I am defining my result list the following way:

result = queryobject.select(mytable.c.columnname == columnname, limit
= maxResults, offset = 0)

maxResults is the number of records I want returned.  In case I want
all the records, I am setting maxResults as -1.  However, this is not
working for me and nothing is being returned.  How can I set the query
so that a -1 limit means return all records?

Thanks


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: sqlalchemy.orm.attributes.InstrumentedList

2007-04-16 Thread Disrupt07

@svilen
Thanks


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: order_by

2007-04-16 Thread Disrupt07

@ml
Thanks


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: sqlalchemy.orm.attributes.InstrumentedList

2007-04-12 Thread Disrupt07

Thanks. 'if isinstance(your_object,
sqlalchemy.orm.attributes.InstrumentedList):'  was helpful to me.

Now I want to check if the given list is either a list of elements or
a list of lists.
Example:
list1 = ['a', 'b', 'c']
list2 = [['a', 'b'], ['c', 'd'], ['e']]

How can I check for lists within a list so that I would know what type
of list I am processing?

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy 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/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] query for a subset of the object's columns

2007-04-05 Thread Disrupt07

I hava a table called mytable (defined in the model as mytable_def)
with the following columns:
  name, surname, age, address, idcard, sex, mobilenumber

I want to query its name and surname columns only, so I am using a
query such as the following:

results=select([mytable_def.c.name,mytable_def.c.surname],
 
distinct=True,order_by=[desc(processlibrary_def.c.popularity)],
   offset=0).execute()

Can I use the SQLAlchemy instance of the mytable_def definition to
query on 2 (only 2, not all columns) of mytable's columns instead of
defining a query similar to the above?

Thanks.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] remove duplicates - DISTINCT constraint

2007-04-03 Thread Disrupt07

I need to populate a table with author names
for example the table name is author and it has a field authorname
of type text.  authorname has the following values:
W. Shakespear
J. Smith
W. Shakespear
R. Williams
K. Winslet
... and so on.

Then I want SQLAlchemy to remove the duplicates, so that W.
Shakespear will be saved only once.

How can I achieve this using SQLAlchemy?
Thanks


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---