Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added license, readme and setup.py

  • Loading branch information...
commit b274619b7a5ffa1ccc68fb049b5815c426549123 1 parent 8a4ae91
@bfirsh bfirsh authored
Showing with 96 additions and 0 deletions.
  1. +24 −0 LICENSE
  2. +53 −0 README.markdown
  3. +19 −0 setup.py
View
24 LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2009, Ben Firshman
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * The names of its contributors may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
53 README.markdown
@@ -0,0 +1,53 @@
+syndication-view
+================
+
+syndication-view is a refactor of Django's syndication contrib app, primarily to
+turn feeds into class-based views, but will also fix a number of [long standing
+tickets](http://code.djangoproject.com/query?status=new&status=assigned&status=reopened&component=RSS+framework&order=priority).
+
+Installation
+------------
+
+ $ python setup.py install
+
+Usage
+-----
+
+`articles/feeds.py`:
+
+ from syndication.views import Feed
+ from articles.models import Article, Category
+
+ class ArticleFeed(Feed):
+ title = "example.com news"
+ link = "/sitenews/"
+ description = "Latest news from example.com."
+
+ def items(self):
+ return Article.objects.all()[:15]
+
+ class CategoryArticleFeed(ArticleFeed):
+ def title(self, obj):
+ return 'example.com: %s' % obj
+
+ def get_object(self, request, slug):
+ return Category.objects.get(slug=slug)
+
+ def items(self, obj):
+ return Article.objects.filter(category=obj)[:15]
+
+`urls.py`:
+
+ from articles.feeds import ArticleFeed, CategoryArticleFeed
+
+ urlpatterns = patterns('',
+ # ...
+ (r'^articles/feed/$', ArticleFeed()),
+ (r'^articles/feed/(?P<slug>[a-z0-9\-]+)/$', CategoryArticleFeed()),
+ # ...
+ )
+
+
+The API for the feed object in syndication.views is almost identical to that in
+[Django's contrib app](http://docs.djangoproject.com/en/dev/ref/contrib/syndication/), except get_object() takes the request and any arguments passed
+to it from the URL rather than the "bits".
View
19 setup.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+from setuptools import setup, find_packages
+
+setup(
+ name='syndication-view',
+ version='0.1',
+ description='Django feeds as a class based views.',
+ author='Ben Firshman',
+ author_email='ben@firshman.co.uk',
+ url='http://github.com/bfirsh/syndication-view/',
+ packages=find_packages(),
+ classifiers=['Development Status :: 4 - Beta',
+ 'Framework :: Django',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: BSD License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',],
+)
Please sign in to comment.
Something went wrong with that request. Please try again.