Django 学习笔记(六)
来源:互联网 发布:linux 播放 4k 视频 编辑:程序博客网 时间:2024/05/21 17:42
Django1.5 关于from django.contrib.syndication.views import Feed 的变更
1.5中只有views.py一个文件,其他的在1.5都删除了
A simple example
This simple example, taken from a hypothetical police beat news site describes a feed of the latest five news items:
from django.contrib.syndication.views import Feedfrom django.core.urlresolvers import reversefrom policebeat.models import NewsItemclass LatestEntriesFeed(Feed): title = "Police beat site news" link = "/sitenews/" description = "Updates on changes and additions to police beat central." def items(self): return NewsItem.objects.order_by('-pub_date')[:5] def item_title(self, item): return item.title def item_description(self, item): return item.description # item_link is only needed if NewsItem has no get_absolute_url method. def item_link(self, item): return reverse('news-item', args=[item.pk])
from django.contrib.syndication.views import feed
- Django学习笔记(六)
- Django 学习笔记(六)
- Django学习笔记(六)Django上传文件
- Django学习笔记(六)--models与mysql数据库接入
- Django学习(六)(模板templates)
- Django学习笔记-初识Django
- Django学习笔记六:form表单实现评论(检验数据合法性)
- Django学习笔记
- django学习笔记
- [学习笔记]Django安装
- Django 学习笔记
- Django学习笔记
- Django学习笔记
- django系统学习笔记
- Django学习笔记
- Django学习笔记
- Django学习笔记
- Django学习笔记(一)
- petsc 矩阵测试
- Populating Next Right Pointers in Each Node II 任意(非完美)二叉树添加next指针 @LeetCode
- Apache HttpClient 4.3开发指南
- bash脚本文件注释
- qsort函数用法
- Django 学习笔记(六)
- hdoj1421 搬寝室 (dp)
- 浏览器内核比较
- [转] VIM解决中文乱码
- ENGLISH资料收集(12)-古代经典著作书名
- ubuntu 彻底删除wine 及 残留的快捷方式
- [常用知识] SQL DB LINK创建
- 鱼还是熊掌:浅谈多进程多线程的选择
- How To Query And Change The Oracle Hidden Parameters In Oracle 10g and 11g (文档 ID 315631.1)