2010-09-17 21:28:46 +00:00
|
|
|
from django.http import Http404
|
2010-08-26 03:43:19 +00:00
|
|
|
from django.shortcuts import render_to_response
|
2010-09-17 21:28:46 +00:00
|
|
|
from mtgweb.analyzer.models import Deck
|
2010-08-26 03:43:19 +00:00
|
|
|
|
|
|
|
def index(request):
|
2010-09-17 21:28:46 +00:00
|
|
|
decks = Deck.objects.all()
|
|
|
|
return render_to_response('decks/index.html', {'decks': decks})
|
|
|
|
def detail(request, id):
|
|
|
|
try:
|
|
|
|
deck = Deck.objects.get(pk=id)
|
|
|
|
except Deck.DoesNotExist:
|
|
|
|
raise Http404
|
|
|
|
return render_to_response('decks/detail.html', {'deck': deck})
|