[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: sqlalchemy.orm.attributes.InstrumentedList

2007-04-12 Thread King Simon-NFHD78

Disrupt07 wrote 
 
 What is sqlalchemy.orm.attributes.InstrumentedList?
 
 I need to use the sqlalchemy.orm.attributes.InstrumentedList type in
 my Python controller methods and need to check if the type of another
 object is of type sqlalchemy.orm.attributes.InstrumentedList.  How can
 I do this? (e.g. using the type() function and what shall I import in
 my controller file?)
 
 Thanks.
 

Well, you could import sqlalchemy.orm.attributes, and then when you want
to check the type of an object you would say 'if isinstance(your_object,
sqlalchemy.orm.attributes.InstrumentedList):'

Simon

--~--~-~--~~~---~--~~
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] 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] Re: sqlalchemy.orm.attributes.InstrumentedList

2007-04-12 Thread svilen

same way, recursively: check 1st element
  if mylist and isinstance( mylist[0], yourlisttype): ...
or check all elements, or...

On Thursday 12 April 2007 17:52:28 Disrupt07 wrote:
 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
-~--~~~~--~~--~--~---