Revision 2a32f17b cloudcmsfaq/views.py

b/cloudcmsfaq/views.py
36 36
from django.views.generic.simple import direct_to_template
37 37
from django.http import HttpResponseRedirect, Http404
38 38

  
39
from cloudcms.models import Application
39
from cloudcms.models import Application, Service
40 40
from cloudcmsfaq.models import Question, Category, CategoryTranslation
41 41

  
42 42
def index(request):
......
47 47
    Display entries list
48 48
    """
49 49
    app = Application.current()
50
    categories = Category.objects.all()
50
    services = Service.objects.all()
51

  
51 52
    return direct_to_template(request,
52
            "cloudcmsfaq/archive.html", {'categories': categories})
53
            "cloudcmsfaq/archive.html", {'services': services})
53 54

  
54
def detail(request, category, slug):
55
def detail(request, service, slug):
55 56
    """
56 57
    Display detailed question.
57 58
    """
58 59
    entry = Question.objects.get(slug=slug)
59
    categories = Category.objects.filter(pk=entry.category.pk)
60
    services = Service.objects.filter(pk=entry.service.pk)
61

  
60 62
    return direct_to_template(request,
61
            "cloudcmsfaq/detail.html", {'question': entry, 
62
                                        'categories': categories})
63
            "cloudcmsfaq/detail.html", {'question': entry,
64
                                        'services': services})
63 65

  

Also available in: Unified diff