create projects app; move Project model to projects app; recreate migrations because moving the model caused problems o.o
This commit is contained in:
parent
a14ab33927
commit
0013410ac1
16 changed files with 108 additions and 25 deletions
20
projects/views.py
Normal file
20
projects/views.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from django.shortcuts import get_object_or_404, render
|
||||
|
||||
from .models import Project
|
||||
from issues.models import Issue
|
||||
|
||||
|
||||
def index(request):
|
||||
project_list = Project.objects.order_by('project_key')
|
||||
return render(request, 'projects/index.html', {
|
||||
'project_list': project_list,
|
||||
})
|
||||
|
||||
|
||||
def view(request, project_key):
|
||||
project = get_object_or_404(Project, project_key=project_key)
|
||||
issue_list = Issue.objects.filter(project=project.id).order_by('create_date')
|
||||
return render(request, 'projects/view.html', {
|
||||
'project': project,
|
||||
'issue_list': issue_list,
|
||||
})
|
||||
Reference in a new issue