In the Pyramid application templates, the model initialization routine
is called 'initialize_sql()'. The corresponding Pylons function is
'init_model()'. I'd argue for the latter (or 'init_models()' because
your models.py is plural) because it's more MVCish, it can be used
with non-SQL databases or multi-database apps, and it doesn't expose
the fact that the model is SQL.

Both Pylons and Pyramid pass an engine object to the function, so that
you can use the model in a standalone utility without depending on the
rest of the app or framework. But the main routine could just pass the
'settings' as is and let the function deal with it, as pyramid_beaker
does. I'm not sure which is better, I like the original behavior. But
it's worth considering as it would allow one to set arbitrary engine
options in the config. (SQLALchemy has a function for this,
engine_from_config().) Although except for echo, I'm not sure the
other options should be set in the config because the app depends on
certain settings.

As for echo, that would be better served by putting the logging
configuration in the INI file.

-- 
Mike Orr <sluggos...@gmail.com>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-de...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to