More abstractly, this is a MVC question. Do I put this in my Model, View, or Controller? I think you are saying that the Model (data store) would be the wrong place to start playing with the data, since you've omitted that option. I'm not sure there is a right, or wrong, answer to your question - but I'm not eliminating the Model from the possibilities. Theoretically, if you have a model for this page that is a wrapper around Quota, I don't see it being any worse to say $m->get_limit() vs $m->get_limit_hr() (human-readable). After all, it's your model that would know what the units are that it's returning (is it in bytes, KB, MB, GB, TB? Or is it returning in bits, trits, or some other unit?). I could easily argue that the Model owns the information, and the Controller should merely be asking for the data in the format it needs to pass on to the View.

Of course, I could argue similarly in favour of Controller and View as the owners of the transformation, but which one would be the strongest argument would depend on the rest of your site, and what types of flexibility are important, as well as any other infrastructure you may have (e.g., translations).


In reply to Re: Catalyst & Pretty Data by Tanktalus
in thread Catalyst & Pretty Data by pileofrogs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.