diff options
author | luxagraf <sng@luxagraf.net> | 2016-03-31 11:09:08 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2016-03-31 11:09:08 -0400 |
commit | 9bc9b213fb5849b20c965b7bd6695b5796ba19ae (patch) | |
tree | bfe475dee42e6ebc814fb1d6c0f270df3627f814 /app/syndication/views.py | |
parent | f81d4cdc61baf6904746ace7226eb6031de32b1a (diff) |
added support for Facebook Instant Articles to syndication app
Diffstat (limited to 'app/syndication/views.py')
-rw-r--r-- | app/syndication/views.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/syndication/views.py b/app/syndication/views.py new file mode 100644 index 0000000..e489846 --- /dev/null +++ b/app/syndication/views.py @@ -0,0 +1,17 @@ +from django.views.generic import ListView + +from .models import SyndicatedItem + + +class FacebookFeedView(ListView): + """ + Return a main entry and list of Entries in reverse chronological order + """ + queryset = SyndicatedItem.objects.filter(syndicate__name__exact="Facebook")[:16] + + def get_template_names(self): + return "fb-feed.xml" + + def render_to_response(self, context, **response_kwargs): + response_kwargs.update({'content_type': 'text/xml'}) + return super(FacebookFeedView, self).render_to_response(context, **response_kwargs) |