Hi, welcome to Python and SQLAlchemy :-)
If you want to do some extra filtering on the results, you can iterate
over the results, decide whether each item matches your filter
conditions, and if it does, append it to a new list, something like
this:
filtered_results = []
for part in query.all():
if <your filter conditions go here>:
filtered_results.append(part)
You can add new properties and methods to your BLPart class. The exact
syntax would depend on how you want to use them. Here's the simplest
example:
class BLPart(db.Model):
# column definitions etc.
ITEMTYPE = Column(...)
# Non-db attributes
foreground = "#000"
background = "#fff"
Now every BLPart instance will have "foreground" and "background"
attributes with those values.
If you need something more complicated than that, let us know how you
would want to use them.
Hope that helps,
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+...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/01812940-c02f-4ad4-9a2d-adfdb736a13cn%40googlegroups.com.