def __init__(self, login): Node.__init__(self) self.login = template.Variable(login)
def __init__(self): Node.__init__(self)
def all(section): nodes_query = Node.all().filter('section =', section.key()).order('inserted') return nodes_query
def index(section): # have to return an iterable (since I have no idea how to assign it to one var in the template) nodes = Node.all().filter('section =', section.key()).filter('name =', 'index') return nodes
def latest(section, limit): nodes_query = Node.all().filter('section =', section.key()).order('-inserted') nodes = None if limit > 0: nodes = nodes_query.fetch(limit) return nodes or nodes_query
def __init__(self, asvar=None): Node.__init__(self) self.asvar = asvar
from django.http import HttpRequest from django.template import Node, RequestContext from django.shortcuts import render_to_response, redirect from mediasync.templatetags.media import BaseTagNode as mds_node S3_PATH = mds_node(Node()).get_media_url(RequestContext( HttpRequest())) + '/img/holidays/' CARD_LIST = [{ 'slug': 'burgess', 'image_url': S3_PATH + 'Burgess%20-%20Image.jpg', 'thumbnail_url': S3_PATH + 'thumbs/Burgess%20-%20Image.jpg', 'audio_url': S3_PATH + 'Burgess%20-%20Audio.mp3', 'email_url': 'http://organizing.sunlightfoundation.com/page/share/capitol-greetings-sledding', 'share_text': "It's going to be tough sledding in the Senate. #CongressSez http://snlg.ht/urKxui via @sunfoundation", }, { 'slug': 'collins1', 'image_url': S3_PATH + 'Collins1%20-%20Image.jpg', 'thumbnail_url': S3_PATH + 'thumbs/Collins1%20-%20Image.jpg', 'email_url': 'http://organizing.sunlightfoundation.com/page/share/capitol-greetings-tree',