I'm new to the MVC structure and am trying to figure out where things
go.

Let's say I've got a group of items.  The index page lists them with a
link to each.  On the item page, it runs a detailed calculation and
prints various output.  For example,

Item 1
Built in 2007.
Initial value $1,000
2008 interest: 30
2009 interest: 31
2010 interest: 32
Current value: 1,093
---------------------------
Item 2
Purchased in 2000 for $100,000
Depreciation over 10 years: 40,000
Current value: $60,000
---------------------------

Currently using PHP, I just use if statements and loops and echo out
to the browser information when its needed.  In web2py, where do I put
the calculation function?  I'm guessing it shouldn't be in either the
controller or in the view.  If I put it in the model, how do I get the
output to the view?  Do I have to create a list and append output
lines to it?  Which calls the calculation function?  The controller or
the view?

Thanks.  Hopefully this makes sense.

Reply via email to