mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-21 23:42:14 +00:00
Add training database index
This commit is contained in:
@@ -17,3 +17,13 @@ class UserTrainingRecordView(generic.DetailView):
|
||||
context = super(UserTrainingRecordView, self).get_context_data(**kwargs)
|
||||
context['categories'] = models.TrainingCategory.objects.all()
|
||||
return context
|
||||
|
||||
|
||||
class SelfUserTrainingRecordView(UserTrainingRecordView):
|
||||
template_name = 'training/index.html'
|
||||
|
||||
def get_queryset(self):
|
||||
pk = self.request.user.id
|
||||
self.kwargs['pk'] = pk
|
||||
|
||||
return self.model.objects.filter(pk=pk)
|
||||
|
||||
Reference in New Issue
Block a user