you'd call it as soon as you reflect your table.
my_table = Table('some_table', metadata, autoload=True)
add_default(my_table)
probably worthwhile to make a function:
def reflect_table(name, metadata):
my_table = Table('some_table', metadata, autoload=True)
add_default(my_table)
return my_table
On Sep 15, 2011, at 10:51 AM, Matt Bodman wrote:
> Hi Michael,
>
> Thanks for your reply. Please be patient with me though as I don't quite get
> it.
>
> Where and when is the add_default function called? Won't I get the same
> error trying to insert 'some default' into the column?
>
> Any further explanation would be great.
>
> Matt
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sqlalchemy/-/05kepNetnrMJ.
> 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.
--
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.