iain duncan <[EMAIL PROTECTED]> writes:

> - I found out that table_name._orig_cols gives me the column names and
> types, but as it's in a dict, it's not ordered

SQL doesn't guarantee order of results unless you explicitly ask for it in a
given order.  I mean, if you have a table with three columns (a, b and c) if
you do "SELECT * FROM table;" the answer can vary in column order (it is
*usually* the creation order altered by the last change you made to the
table).  The only way to always get a give order is "SELECT a, b, c FROM
table;". 

In any case, the order doesn't matter.  You're dealing with objects and
properties so you'll end up with table.c.a, table.c.b and table.c.c that you
can use on other operations or with equivalent properties that you'll be
accessing.

> - the repr of a table name gives the Table object, which has the columns
> listed in order. Before I do something stupid like slice up this repr
> with reg exes, is there an easy way to access the columns and their
> attributes in the order they are declared in the Table call?

I can't answer that -- yet -- but that is the kind of ordering that I'd expect
seeing on some tool...  Of course this is an artificial order, but we usually
structure things in some logical way that helps seeing our intentions.

> Lastly, is anyone working on this kind of stuff with pointers or code
> that I should look at? I'm sure I'm going to do some silly stuff on my
> own. ;)

If you're trying to make something like what Django has, why not looking how
they did it? ;-)

-- 
Jorge Godoy      <[EMAIL PROTECTED]>


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to