It sounds interesting. One question: if today=Wednesday and the record date=Tuesday do you categorise the record as "yesterday", "this week", "this month" or possibly all 3? Ignoring that for the time being, my first thought is two functions.
The view function takes 2 dates - "today" and the record date and returns the categorisation, i.e. "yesterday". The controller function takes a categorisation and todays date and returns 2 dates - a from- date and a to-date that can be used in the select condition - for "today" and "yesterday", the from and to dates will be equal. The controller function looks "global" (if that's the right term). How would you call the view function? Using represent= in the model? Can you specify represent= in the view - that would be ideal if you could? Can you loop thru the rows and add a categorisation TD? Does that make sense? Are using the t2 modified_on stamp as the record date? On Oct 20, 2:16 am, mdipierro <[EMAIL PROTECTED]> wrote: > I like both your ideas. I do not really have any good suggestions but > I would like to seem both of them implemented. > > Massimo > > On Oct 19, 6:56 pm, "Steve Shepherd" <[EMAIL PROTECTED]> wrote: > > > Hi > > I am designing a class that works like a display and edit list (for using > > alongside soething like itemize in T2) > > > So her goes: > > > Its called SQLVIEW > > > I want to hook this to a table (that is developed in DAL) and the SQLVIEW > > class automatically adds some methods and helpers. > > > But I have a question about where this should sit whether it is M C or V. > > > Here is the question: > > If I am creating a method that will display a Date as (Today, Yesterday, > > This Week, Last Week etc etc) > > Should this be a view helper or should it be part of the model or > > controller? > > The raw data is the date on file and todays date (client side not server > > side) to calculate what should be displayed. > > > My thinking is it should be a View helper but I may want to use this field > > as a grouping or sort field this means moving it back to the controller. > > > Anyone's thoughts > > > PS. I am thinking of adding an updated stamp method called AUDIT which will > > keep a list of users and dates that are modified on a record this way I can > > do some easy displays of when things were last changed on a record. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

