summaryrefslogtreecommitdiffstats
path: root/news/models.py
AgeCommit message (Collapse)AuthorFilesLines
2012-03-24Make all datetime objects fully timezone awareDan McGee1-3/+4
This is most of the transition to Django 1.4 `USE_TZ = True`. We need to ensure we don't mix aware and non-aware datetime objects when dealing with datetimes in the code. Add a utc_now() helper method that we can use most places, and ensure there is always a timezone attached when necessary. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-08Utilize Django 1.3 'on_delete' feature on several foreign keysDan McGee1-1/+2
The most important one here is PROTECT to keep people from making bone-headed plays and deleting an Arch or Repo and every package along with it. We can use this in a few other places, as well as some carefully placed SET_NULL indicators. Note that nothing here pushes deletion responsibilities down to the database, although that will probably happen in a future commit. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-08Consolidate caching black magicDan McGee1-2/+2
Get the stuff used to retrieve and refresh the latest date values all in the same place, and make it a bit more beautiful by refactoring it all into a common set of methods. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-08Use UTC datetime objects everywhereDan McGee1-1/+1
Rather than the twisted mix of local times and UTC times we currently have. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-08Ensure feed GUIDs are unchanging and uniqueDan McGee1-4/+20
Implement 'tag:' style URIs for the GUID field on our RSS feeds. This ensures new package updates show up as new, and we aren't jumping back and forth between generated GUIDs having 'http://' and 'https://' prefixes. Much of the work here is to attempt to keep old news GUIDs constant so we don't once again make everything show up as new in newsreaders. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-08Remove automatic ID column definitionsDan McGee1-1/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-14Connect post_save signals where they will always be triggeredDan McGee1-0/+6
We need to do this in the models.py files, otherwise the post_save signal might not be connected right away on launch of the application. Move them over there, add a dispatch_uid so it only gets hooked up once, and do some other function moving around so we don't have circular imports. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21Update news views to use slug instead of IDDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21Add migrations to populate the news slug and make it non-nullDan McGee1-1/+1
These should get us all set to have more useful URLs for the news items. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21Add news slug fieldDan McGee1-0/+1
Initially, this needs to allow null so that we can add in slugs for all of our old news items. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-15Spruce up news admin viewDan McGee1-2/+2
Add last modified date as a column, and fix up some other small display, sorting, and ordering issues. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-15Add last modified date to newsDan McGee1-1/+3
This will come in handy when determining whether resources are out of date, such as our news RSS feed. Also bump the Date fields to DateTime fields for sake of sorting and if we have more than one news item on the same date. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08Move news model to an appropriate placeDan McGee1-0/+23
Never would have guessed it should actually be in news/models.py. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08Put news under south controlDan McGee1-0/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08Moved models aroundeliott1-21/+0
2007-12-30Removed import no longer used.eliott1-1/+0
2007-12-30Massive retab fest.eliott1-12/+15
Also added vim command comment to the end of files.
2007-12-22renamed importseliott1-1/+1
2007-11-03Initial import for public release...eliott1-0/+19
Special Note Prior to git import, approx 90% of the code was done by Judd Vinet. Thanks Judd!