All pastes #2081822 Raw Edit

Untitled

public python v1 · immutable
#2081822 ·published 2011-09-21 13:26 UTC
rendered paste body
cms appclass LinkApphook(CMSApp):    name = _("Link Display")    urls = ["linker.urls"]apphook_pool.register(LinkApphook)url.pyurlpatterns = patterns('linker.views',		url(r'^$', object_list, dict(queryset=Link.objects.filter(published=True), template_object_name='link', template_name='linker/index.html', paginate_by=15, allow_empty=True)),)template that works without extenting base:{% extends "base.html" %}{% load cms_tags %}{% load voting_tags %}{% votes_by_user user on link_list as vote_user_dict %}{% vote_counts_for_objects link_list as vote_counts_dict %}{% block title %}Link {{ link.title}}{% endblock %}{% block base_content %}<table><col width="1"></col><col></col><thead>  <tr>    <th>Vote</th>    <th>Link</th>  </tr></thead><tbody>  {% for llink in link_list %}		<tr class="{% cycle odd,even %}">    <td class="vote">			{% dict_entry_for_item llink from vote_user_dict as vote_user %}			{% dict_entry_for_item llink from vote_counts_dict as vote_counts %}	    <form class="linkvote" id="linkup{{ llink.id }}" action="/linker/vote/{{ llink.id }}/{% if vote and vote.is_upvote %}clear{% else %}1{% endif %}vote/" method="POST">				{% csrf_token %}        <input type="image" id="linkuparrow{{ llink.id }}" src="{{ STATIC_URL }}css/up.png">      </form>      <form class="linkvote" id="linkdown{{ link.id }}" action="/linker/vote/{{ llink.id }}/{% if vote and vote.is_downvote %}clear{% else %}-1{% endif %}vote/" method="POST">				{% csrf_token %}        <input type="image" id="linkdownarrow{{ link.id }}" src="{{ STATIC_URL }}css/down.png">      </form>		    </td>		    <td class="item">		      <a href="{{ llink.url }}">{{ llink.title|escape }}</a></h2>		      <p class="details">		        <span class="score" id="linkscore{{ llink.id }}"		              title="after {{ vote_user.num_votes|default:0 }} vote{{ vote_user.num_votes|default:0|pluralize }}">									{{ vote_user }} - {{ vote_counts }}		         			{{ vote_counts.score }}point{{ vote_user.score|pluralize }}									        after {{ vote_user.vote_counts }} vote{{ vote_user.vote_counts|pluralize }}		        </span>		        posted {{ link.submitted|timesince }} ago by		        <span class="user"><a href="../user/{{ link.user.id }}/">{{ link.user.get_full_name|escape }}</a></span>		        <span class="details"><a href="">details</a></span>		      </p>		    </td>		  </tr>{% endfor %}		</tbody>		</table>		{% for i in vote_counts.items %} 		    Key  {{ i.0 }} 		    Value  {{ i.1 }} 		{% endfor %}{% endblock %}