The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: winnrar | June 12, 2010 @ 10:36pm
PHP Code
[
Download
]
-------feeds.py----- from django.contrib.syndication.feeds import Feed from bibbase2.models import News class LatestEntriesFeed(Feed): title = "Bibbase2 site news" link = "/sitenews/" description = "Updates on changes and additions to bibbase2" def items(self): return News.objects.order_by('-pub_date')[:5] def item_title(self, item): return item.headline def item_description(self, item): return item.text -------urls.py------- from bibbase2.models import * from django.conf.urls.defaults import * from django.contrib import admin from bibbase2.RSS.feeds import LatestEntriesFeed urlpatterns = patterns('', # ... (r'^latest/feed/$', LatestEntriesFeed()), # ... )
Syntax Highlighting
[
Open in new window
]
Author Comments
feeds.py is contained in folder bibbase2/RSS
where bibbase2/ contains views.py models.py and etc
Rating
4.64 / 8
42 Votes
http://codebin.yi.org/687
page generated in 0.01 seconds