On Fri, Mar 8, 2019 at 10:54 PM Rich Shepard <rshep...@appl-ecosys.com> wrote:
>
> Two classes in the model have columns with values constrained to specific
> text strings; one table has two such columns, another table has one.
>
> Because new strings might be added to the lists of allowed values for that
> column each has the acceptable values as rows in a table rather than in a
> column constraint.
>
> SQL queries processed by SA to select rows in each table return sets. How do
> I transpose each set to a python list can will be used by tkinter to display
> them in a ttk.Combobox?

I'm not sure exactly what you mean here. You can write a function that
iterates over the rows and selects the attributes that you want. For
something more automated, you could use an association proxy, as in
the "Simplifying Scalar Collections" example at
https://docs.sqlalchemy.org/en/latest/orm/extensions/associationproxy.html#simplifying-scalar-collections

>
> Because these lists need to be present before the classes for the associated
> tables are processed how should the queries and lists be represented in the
> view module? In a separate class?

Normally, your class definitions correspond to the "shape" of the
database (ie. the tables), rather than the contents of those tables,
so I don't really know what you mean by "the lists need to be present
before the classes for the associated tables are processed". Can you
give an example?

Thanks,

Simon

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to