Commit Graph

18 Commits

Author SHA1 Message Date
Dan McGee
6fe08cd689 Utilize Django 1.3 'on_delete' feature on several foreign keys
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-07 17:04:00 -05:00
Dan McGee
77842a6c76 Consolidate caching black magic
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-07 17:03:13 -05:00
Dan McGee
01db07bad8 Use UTC datetime objects everywhere
Rather than the twisted mix of local times and UTC times we currently have.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-07 17:03:00 -05:00
Dan McGee
9f4902f9c9 Ensure feed GUIDs are unchanging and unique
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-04-07 17:01:16 -05:00
Dan McGee
c18cd21e53 Remove automatic ID column definitions
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-08 11:49:37 -06:00
Dan McGee
97d1e4164b Connect post_save signals where they will always be triggered
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-10-13 18:11:28 -05:00
Dan McGee
41dc37c812 Update news views to use slug instead of ID
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:02 -05:00
Dan McGee
7c92ddbd3c Add migrations to populate the news slug and make it non-null
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-21 09:10:02 -05:00
Dan McGee
190d0fc154 Add news slug field
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-21 09:09:01 -05:00
Dan McGee
8a3bd1ad8a Spruce up news admin view
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-15 09:04:00 -05:00
Dan McGee
1a18ca4771 Add last modified date to news
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-14 17:39:17 -05:00
Dan McGee
f637a1eb67 Move news model to an appropriate place
Never would have guessed it should actually be in news/models.py.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 00:23:55 -05:00
Dan McGee
4e193afcea Put news under south control
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 00:15:30 -05:00
eliott
9b7b512254 Moved models around 2008-03-08 00:13:41 -08:00
eliott
89659cef5f Removed import no longer used. 2007-12-29 16:53:03 -08:00
eliott
3e297efad8 Massive retab fest.
Also added vim command comment to the end of files.
2007-12-29 16:42:55 -08:00
eliott
bd9a99d791 renamed imports 2007-12-22 16:21:21 -05:00
eliott
39a548fd26 Initial import for public release...
Special Note
  Prior to git import, approx 90% of the code was done by Judd Vinet. Thanks Judd!
2007-11-03 03:45:10 -04:00