Skip to content

Instantly share code, notes, and snippets.

Created February 5, 2012 22:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# -*- coding: utf-8 -*-
from django.template import Context, loader
from gallery.models import Album
def parse(kwargs):
id = kwargs.get('numer')
title = kwargs.get('tytul', True)
if title == 'brak':
title = False
if not id.isdigit():
return "[Nieporawny numer galerii]"
album = Album.objects.get(id=id, public=True)
except Album.DoesNotExist:
return "[Nie ma takiej galerii lub jest nieopublikowana]"
template = loader.get_template('gallery/album-embedded.html')
context = Context({
'title': title,
'album': album,
return template.render(context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment