summaryrefslogtreecommitdiffstats
path: root/feeds.py
AgeCommit message (Collapse)AuthorFilesLines
2011-04-08Consolidate caching black magicDan McGee1-39/+5
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-18/+4
Rather than the twisted mix of local times and UTC times we currently have. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-08Add a horrible hack to allow feed guid value to not be a permalinkDan McGee1-0/+23
Django, you make the simplest things so damn hard sometimes. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-08Ensure feed GUIDs are unchanging and uniqueDan McGee1-0/+14
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-02-15Use date from model in news feedDan McGee1-4/+5
Now that this a datetime and not just a date, we can use it directly. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-11-27Fix feeds for case-sensitive databasesDan McGee1-1/+1
This worked in MySQL because of it's case-insensitive matching, but does not work in other databases unless we coerce the value. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-14Connect post_save signals where they will always be triggeredDan McGee1-23/+2
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-09Fix potential race conditions in cachingDan McGee1-14/+14
Use a 'set to None' sentinel to indicate data updates are in progress and we need to hold off a bit on caching a new value. This logic is gleamed from the "Scaling Django" slides presented by Mike Malone and available freely on SlideShare. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-08Ensure last modified times use UTCDan McGee1-0/+16
We were cheating before and using non-UTC times; adjust the values we get back from the database as appropriate so our times are not bogus. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-08Store package feed last modified date in memcachedDan McGee1-9/+28
Just like what we did for news items, we can do the same for packages. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-08Store latest news date in memcachedDan McGee1-2/+23
This saves two database queries each request, meaning no database hits at all if we are just going to return a 304 response. It also requires adding a post_save signal to ensure our cache is updated with the correct latest news date upon saving a news item. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-08Factor out common last modified code for news feedDan McGee1-7/+12
This will set up retrieving this value from memcached as well as some other changes to come. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-15Improve request handling for feeds that haven't changedDan McGee1-0/+37
By using the condition decorator (in a slightly odd way because these are class-based views), we can cut down a lot on the response time for returning 304 status code for feeds that haven't changed. The decorator means we no longer have to completely render the view to see if we can return a 304 status code. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08Use arch.agnostic flag everywhereDan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08Move news model to an appropriate placeDan McGee1-1/+3
Never would have guessed it should actually be in news/models.py. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-28PyLint suggested cleanupsDan McGee1-2/+1
We had a bunch of extra imports, non-conventional variable names, spacing issues, etc. that were relatively low-hanging fruit to clean up. Fix them and make the code a bit cleaner in the process. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27Remove an unnecessary iexactDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-08Update feeds to new 1.2 frameworkDan McGee1-11/+11
Feeds are now views-based and don't need the dictionary anymore. get_object() now takes named arguments as well making it a bit more understandable when reading the code. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-04feeds: move link from method to attributeDan McGee1-3/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-10Remove archweb prefix from all importsDan McGee1-1/+1
Unnecessary, and lets us standardize on not using it everywhere. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-05feeds: add per arch, per repo feed abilityDan McGee1-9/+51
Make the feed framework a lot more flexible and give the possibility to have a feed for each architecture. You can drill down even more than also get a feed for a particular repo; some might find this helpful for something like tracking [testing]. Implements FS#12939. I also bumped up the number of items available in each of these feeds; since it is full of a bunch of small items it might be more helpful to have more available and it should also prevent fewer ones from being missed. The UI isn't exactly spectacular, but I figured some sort of page is better than none listing all the various feeds you can pull from. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-31Make the feed titles more descriptiveDan McGee1-5/+4
FS#16752. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-31Use select_related() to make a few more places more performantDan McGee1-2/+2
Especially when looking at packages, we always want the arch and repo. Another big hunk of changes deals with the very inefficient signoffs code. Signed-off-by: Dan McGee <dan@archlinux.org>
2009-11-10added feeds from archweb_pubIsmael Carnales1-0/+36
2007-12-30Removed feeds from devsiteeliott1-35/+0
2007-12-30Massive retab fest.eliott1-0/+2
Also added vim command comment to the end of files.
2007-12-22renamed importseliott1-2/+2
2007-11-17Stupid change.eliott1-1/+1
2007-11-07Retab.eliott1-16/+16
2007-11-07Fix bug FS#8417eliott1-0/+4
2007-11-03Initial import for public release...eliott1-0/+29
Special Note Prior to git import, approx 90% of the code was done by Judd Vinet. Thanks Judd!