Quoting Mike Orr <[email protected]>:

On Wed, Mar 2, 2011 at 4:11 PM, Dan Sommers <[email protected]> wrote:
I'm having a difficult time coming up with an approach to
configuration settings that "belong" to the Model.  Or perhaps I don't
quite have my head around something else.

Anyway, for example, consider a settings for controlling outbound
email from my application.  During development, I want certain email
sent to my personal account, but in production, I want that email sent
to the actual Help Desk queue.  So I have a couple of entries in my
development.ini file, and then as part of deployment, I create a
production.ini file with slightly different values.  So far, so good.

The initialization function sounds like the best way ...

Thanks.  Shortly after I posted my question, Chris McDonough answered a
question in another thread and recommended a "mailer" factory function;
that's essentially the same thing, too.

It's not that common to use settings in the model except for the db
connection, so that may be why you aren't finding documentation on it.
I also don't understand why the model would want to send mail, that
sounds like an un-model-like thing to do. Usually the view would call
a function to send mail.

Those are some of the lines that can be tough to draw.  If I limit my model
strictly to persistent data, then you're right:  sending email falls outside.
I guess I tend to think of my model as the whole application, though, and
the views are just the server-side piece of the user interface.  My views
tend to be very small and really just pass information to the model and
"direct traffic" based on the results of the model doing the real work (which
could just be a throwback to my embedded system days).

Thanks again,
Dan

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to