alviandk / django-voting

Automatically exported from code.google.com/p/django-voting
0 stars 0 forks source link

Add date_submitted field on votes. #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
A few of us at PyCon are working on a Django community site, and one thing
that we'd like to do is dilate the votes based on the age of the vote. 
This would only be possible if there were some sort of a date_submitted
field on the Vote object.

Would that be possible to add?

Original issue reported on code.google.com by flo...@gmail.com on 16 Mar 2008 at 5:53

GoogleCodeExporter commented 8 years ago
I have a patch for this.
I ran the tests and they were no regressions.

Simple model change.

Original comment by thau...@gmail.com on 16 Mar 2008 at 8:49

Attachments:

GoogleCodeExporter commented 8 years ago
I have a patch for this too - please let me know what it needs to get 
integrated.

- Model got a timestamp field ( the path above calls this field date_submitted )
- Managers get_top and get_bottom methods take an extra 'since' parameter that 
allow for "what's hot 
{today,thisweek,thismonth,thisyear,whatever}" queries.

Original comment by tbac...@gmail.com on 29 May 2008 at 9:30

Attachments:

GoogleCodeExporter commented 8 years ago
I also have a patch. Model change, plus the datestamp updates if a vote is 
changed.

Original comment by aron.jo...@gmail.com on 28 Nov 2008 at 11:07

Attachments:

GoogleCodeExporter commented 8 years ago
I'm not sure what I was thinking. Using auto_now on the DateField is way better 
then
the patch I submitted.

Original comment by aron.jo...@gmail.com on 28 Nov 2008 at 11:18

GoogleCodeExporter commented 8 years ago
aron: No, auto_now is generally considered bad practice. The only reason it is 
still in Django is due to an 
oversight in the release 1.0.  It should have been removed.  So, while it's 
still "supported" it's not a good idea to 
use it because it's going to be one of the first things to go once backwards 
incompatible changes start 
happening again in a few years.

Original comment by flo...@gmail.com on 28 Nov 2008 at 11:21

GoogleCodeExporter commented 8 years ago
I submitted ticket #20 on this issue not realizing that there is overlap with 
this
one.  Is this ticket or the others under consideration or are we at a 
standstill?

Original comment by arocki...@gmail.com on 2 Feb 2009 at 4:55