mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-19 14:32:16 +00:00
Add description field to TrainingItems (#523)
* Add 'description' field to TrainingItems Renamed existing field to name, removed the dummy property. * Initial version of training item export view * Fix line length issue and better spacing on exported PDF * Added export button to item list * pep8 * Implement code doctor tweaks * Attempt to fix odd deployment issue * Pad headers slightly * Fix page numbering
This commit is contained in:
@@ -7,7 +7,7 @@ from django.db import transaction
|
||||
from django.db.models import Q, Count
|
||||
from django.db.utils import IntegrityError
|
||||
|
||||
from PyRIGS.views import is_ajax, ModalURLMixin, get_related
|
||||
from PyRIGS.views import is_ajax, ModalURLMixin, get_related, PrintListView
|
||||
from training import models, forms
|
||||
from users import views
|
||||
from reversion.views import RevisionMixin
|
||||
@@ -24,6 +24,17 @@ class ItemList(generic.ListView):
|
||||
return context
|
||||
|
||||
|
||||
class ItemListExport(PrintListView):
|
||||
model = models.TrainingItem
|
||||
template_name = 'item_list.xml'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['filename'] = "TrainingItemList.pdf"
|
||||
context["categories"] = models.TrainingCategory.objects.all()
|
||||
return context
|
||||
|
||||
|
||||
class TraineeDetail(views.ProfileDetail):
|
||||
template_name = "trainee_detail.html"
|
||||
model = models.Trainee
|
||||
|
||||
Reference in New Issue
Block a user