typically if I had “create_all()” running in my app I’d probably have a 
function like “install_payload()” right after it that puts in all the data we 
need.

actually what I usually do is a pipeline approach:

install_app() ->   create_tables(), install_payload_x(), install_payload_y(), 
etc.



On Nov 11, 2013, at 7:54 AM, Richard Gerd Kuesters <[email protected]> 
wrote:

> Hi all,
> 
> I have a CI that generates my app database. So far so good.
> 
> I would like to tweak them a bit. So, many of these instances (like Language) 
> can have pre-populated values (en_US, pt_BR, es_ES, etc). what's the 
> "recommended" technique (or more close to python+SA) to accomplish this?
> 
> For now, I'm using the after_create event, but it doesn't work with 
> declarative (unless "Language.__table__" is used), but I would rather use the 
> "natural" way of creating objects "lang = Language('pt_BR'); 
> session.add(lang)"
> 
> 
> Any ideas?
> 
> Kind regards,
> Richard.
> 
> -- 
> 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.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to