Jeff Watkins, el jueves 29 de diciembre a las 19:44 me escribiste:
> 
> Leandro, thanks for responding. I'm glad I didn't miss any of the  
> possibilities. I chose to keep a table for ProductViews because this  
> allows me to graph the information over time: what was hot this week,  
> what was hot last month, etc.

This is nice =)
Doesn't that looks more like a log than a table? Anyways, having it no a
sql table could be more flexible and powerfull.

> Part of what makes this difficult is that I really want a HOT product  
> list. And hot products are determined by a formula:
> 
>      2*number of views on the home page +
>      5*number of views of the product page +
>     10*number of times the product was ordered
> 
> This makes the query pretty hairy. I decided to implement it as a  
> class method called hot_products. This way the caller can limit the  
> actual number himself.
> 
> Of course, I *could* have stashed this information in the Product  
> record, but then I'd be unable to report on the trends.

Yes, I understand...

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
 .------------------------------------------------------------------------,
  \  GPG: 5F5A8D05 // F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05 /
   '--------------------------------------------------------------------'
Hello?
Is there anybody in there?
Just nod if you can hear me.
Is there anyone at home?

Reply via email to