stat

An article by Gaspard Bucher

display statistical information for a list/group

  1. action
  2. ajax
  3. API
  4. classes
  5. common attributes
  6. conditions
  7. context
  8. dates
  9. display
    1. add_btn
    2. add_document
    3. admin_links
    4. comments_count
    5. content_lang
    6. design
    7. filter
    8. flash_messages
    9. h
    10. img
    11. javascripts
    12. mail_hide
    13. min / max
    14. search_box
    15. set
    16. show
    17. stat
    18. stylesheets
    19. summary
    20. text
    21. title
    22. uses_datebox
    23. zazen
    24. zena
  10. forms
  11. i18n
  12. meta
  13. SQLiss
  14. urls

display statistical information for a list/group

  • find (min, max, sum, count) default ‘count’
  • date same as ‘find’ for dates
  • format (sprintf format, date format)
  • of field (default ‘value’)
  • from same as ‘of’
see group
<r:data do='stat' find='sum' format='%.3f'/>
<r:pages do='stat' find='sum' of='d_hours'/>
<r:pages do='stat' date='min' of='log_at' format='%Y'/>

It is usually a bad idea to use ‘count’ through ‘stat’. We should implement count without the overload of finding all records.