There is "column_reflect" event triggered for each column during table
reflection. Most likely your extra functionality depends on some columns so
I'd look at something like:
from sqlalchemy.event import listens_for
columns_to_reflect = set(('id', 'name', 'real_name',
'really_real_name'))
@listens_for(my_table, 'column_reflect'):
def column_reflected(inspector, table, column_info):
columns_to_reflect.remove(column_info['name'])
if not columns_to_reflect:
do_my_dirty_job(table)
It does not help to have no "table_reflected" event though. May be this
should become a feature request.
On Wednesday, July 31, 2013 1:34:46 PM UTC-4, tiadobatima wrote:
>
> Hello there,
>
> When this application starts, we reflect the DB into a MetaData() object
> and this is made available for everyone to use.
> I'd like to add a few more methods to the table objects within that
> MetaData(). Is there any easy way to extend these already
> instantiated sqlalchemy.schema.Table objects?
>
> Thanks! :)
>
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.