[Oi-commits] r2571 - in trunk: . st templates
oi-svn at pardus.org.tr
oi-svn at pardus.org.tr
Fri May 29 18:04:25 EEST 2009
Author: jnmbk
Date: Fri May 29 18:04:25 2009
New Revision: 2571
Modified:
trunk/st/feeds.py
trunk/templates/base.html
trunk/urls.py
Log:
RSS and Atom for workshop
Modified: trunk/st/feeds.py
=================================================================
--- trunk/st/feeds.py (original)
+++ trunk/st/feeds.py Fri May 29 18:04:25 2009
@@ -8,8 +8,8 @@
from django.contrib.syndication.feeds import Feed
from django.utils.feedgenerator import Atom1Feed
-from oi.st.models import Game, FS, News, Package, HowTo
-from oi.settings import WEB_URL, SITE_NAME, SITE_DESC, NEWS_IN_HOMEPAGE, PACKAGES_IN_HOMEPAGE, GAMES_IN_HOMEPAGE, FS_IN_HOMEPAGE, HOWTOS_IN_HOMEPAGE, NEWS_PER_PAGE, PACKAGE_PER_PAGE, GAME_PER_PAGE, FS_PER_PAGE, HOWTO_PER_PAGE
+from oi.st.models import Game, FS, News, Package, HowTo, Workshop
+from oi.settings import WEB_URL, SITE_NAME, SITE_DESC, NEWS_IN_HOMEPAGE, PACKAGES_IN_HOMEPAGE, GAMES_IN_HOMEPAGE, FS_IN_HOMEPAGE, HOWTOS_IN_HOMEPAGE, NEWS_PER_PAGE, PACKAGE_PER_PAGE, GAME_PER_PAGE, FS_PER_PAGE, HOWTO_PER_PAGE, WORKSHOP_PER_PAGE
class CommonFeed(Feed):
link = WEB_URL
@@ -110,3 +110,15 @@
class Package_Atom(Package_RSS):
feed_type = Atom1Feed
subtitle = Package_RSS.description
+
+class Workshop_RSS(CommonFeed):
+ title = SITE_NAME + " - Atölye"
+ title_template = 'feeds/feed_title.html'
+ description_template = 'feeds/feed_description.html'
+
+ def items(self):
+ return Workshop.objects.filter(status=1).order_by('-update')[:WORKSHOP_PER_PAGE]
+
+class Workshop_Atom(Workshop_RSS):
+ feed_type = Atom1Feed
+ subtitle = Package_RSS.description
Modified: trunk/templates/base.html
=================================================================
--- trunk/templates/base.html (original)
+++ trunk/templates/base.html Fri May 29 18:04:25 2009
@@ -14,6 +14,7 @@
<link rel="alternate" type="application/rss+xml" title="Özgürlükİçin RSS - Nasıl" href="/rss/nasil" />
<link rel="alternate" type="application/rss+xml" title="Özgürlükİçin RSS - İlk Adımlar" href="/rss/ia" />
<link rel="alternate" type="application/rss+xml" title="Özgürlükİçin RSS - Paketler" href="/rss/paket" />
+<link rel="alternate" type="application/rss+xml" title="Özgürlükİçin RSS - Atölye" href="/rss/atolye/" />
<link rel="alternate" type="application/rss+xml" title="Özgürlükİçin RSS - Oyunlar" href="/rss/oyun" />
<link rel="alternate" type="application/rss+xml" title="Özgürlükİçin RSS - Gezegen" href="/rss/gezegen/" />
<link rel="alternate" type="application/rss+xml" title="Özgürlükİçin RSS - Forum" href="/forum/rss/post/" />
Modified: trunk/urls.py
=================================================================
--- trunk/urls.py (original)
+++ trunk/urls.py Fri May 29 18:04:25 2009
@@ -24,6 +24,7 @@
'oyun': Game_RSS,
'paket': Package_RSS,
'nasil': HowTo_RSS,
+ 'atolye': Workshop_RSS,
}
atom_dict = {
@@ -33,6 +34,7 @@
'oyun': Game_Atom,
'paket': Package_Atom,
'nasil': HowTo_Atom,
+ 'atolye': Workshop_Atom,
}
package_dict = {
More information about the Oi-commits
mailing list