from datetime import datetime
from django.core.urlresolvers import reverse
from django.shortcuts import render
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateView
from ..models.log_entry import LogEntry

from ..util import paginate, get_current_group


def log_entries(request):
	entries = LogEntry.objects.all()
	return render(request, 'students/log_entry.html', {'entries': entries})

class LogEntryList(TemplateView):
	template_name = "students/log_entry.html"

	def dispatch(self, request, *args, **kwargs):
		return super(LogEntryList, self).dispatch(request, *args, **kwargs)

	def get_context_data(self, **kwargs):
		context = super(LogEntryList, self).get_context_data(**kwargs)
		entries = LogEntry.objects.all()

		order_by = self.request.GET.get('order_by', '')
		if order_by:
			entries = LogEntry.objects.order_by(order_by)
			reverse = self.request.GET.get('reverse', '')
			if reverse == '1':
				entries = entries.reverse()
		else:
			entries = LogEntry.objects.order_by('asctime')
		
		paginate_by = 6

		context = paginate(entries, paginate_by, self.request, context, var_name='entries')

		return context


a9bbcff4312d127f021083afbcf7574a1e34e6d0
<mask token>


class LogEntryList(TemplateView):
    <mask token>

    def dispatch(self, request, *args, **kwargs):
        return super(LogEntryList, self).dispatch(request, *args, **kwargs)

    def get_context_data(self, **kwargs):
        context = super(LogEntryList, self).get_context_data(**kwargs)
        entries = LogEntry.objects.all()
        order_by = self.request.GET.get('order_by', '')
        if order_by:
            entries = LogEntry.objects.order_by(order_by)
            reverse = self.request.GET.get('reverse', '')
            if reverse == '1':
                entries = entries.reverse()
        else:
            entries = LogEntry.objects.order_by('asctime')
        paginate_by = 6
        context = paginate(entries, paginate_by, self.request, context,
            var_name='entries')
        return context

<mask token>


class LogEntryList(TemplateView):
    template_name = 'students/log_entry.html'

    def dispatch(self, request, *args, **kwargs):
        return super(LogEntryList, self).dispatch(request, *args, **kwargs)

    def get_context_data(self, **kwargs):
        context = super(LogEntryList, self).get_context_data(**kwargs)
        entries = LogEntry.objects.all()
        order_by = self.request.GET.get('order_by', '')
        if order_by:
            entries = LogEntry.objects.order_by(order_by)
            reverse = self.request.GET.get('reverse', '')
            if reverse == '1':
                entries = entries.reverse()
        else:
            entries = LogEntry.objects.order_by('asctime')
        paginate_by = 6
        context = paginate(entries, paginate_by, self.request, context,
            var_name='entries')
        return context

<mask token>


def log_entries(request):
    entries = LogEntry.objects.all()
    return render(request, 'students/log_entry.html', {'entries': entries})


class LogEntryList(TemplateView):
    template_name = 'students/log_entry.html'

    def dispatch(self, request, *args, **kwargs):
        return super(LogEntryList, self).dispatch(request, *args, **kwargs)

    def get_context_data(self, **kwargs):
        context = super(LogEntryList, self).get_context_data(**kwargs)
        entries = LogEntry.objects.all()
        order_by = self.request.GET.get('order_by', '')
        if order_by:
            entries = LogEntry.objects.order_by(order_by)
            reverse = self.request.GET.get('reverse', '')
            if reverse == '1':
                entries = entries.reverse()
        else:
            entries = LogEntry.objects.order_by('asctime')
        paginate_by = 6
        context = paginate(entries, paginate_by, self.request, context,
            var_name='entries')
        return context

from datetime import datetime
from django.core.urlresolvers import reverse
from django.shortcuts import render
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateView
from ..models.log_entry import LogEntry
from ..util import paginate, get_current_group


def log_entries(request):
    entries = LogEntry.objects.all()
    return render(request, 'students/log_entry.html', {'entries': entries})


class LogEntryList(TemplateView):
    template_name = 'students/log_entry.html'

    def dispatch(self, request, *args, **kwargs):
        return super(LogEntryList, self).dispatch(request, *args, **kwargs)

    def get_context_data(self, **kwargs):
        context = super(LogEntryList, self).get_context_data(**kwargs)
        entries = LogEntry.objects.all()
        order_by = self.request.GET.get('order_by', '')
        if order_by:
            entries = LogEntry.objects.order_by(order_by)
            reverse = self.request.GET.get('reverse', '')
            if reverse == '1':
                entries = entries.reverse()
        else:
            entries = LogEntry.objects.order_by('asctime')
        paginate_by = 6
        context = paginate(entries, paginate_by, self.request, context,
            var_name='entries')
        return context

from datetime import datetime
from django.core.urlresolvers import reverse
from django.shortcuts import render
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateView
from ..models.log_entry import LogEntry

from ..util import paginate, get_current_group


def log_entries(request):
	entries = LogEntry.objects.all()
	return render(request, 'students/log_entry.html', {'entries': entries})

class LogEntryList(TemplateView):
	template_name = "students/log_entry.html"

	def dispatch(self, request, *args, **kwargs):
		return super(LogEntryList, self).dispatch(request, *args, **kwargs)

	def get_context_data(self, **kwargs):
		context = super(LogEntryList, self).get_context_data(**kwargs)
		entries = LogEntry.objects.all()

		order_by = self.request.GET.get('order_by', '')
		if order_by:
			entries = LogEntry.objects.order_by(order_by)
			reverse = self.request.GET.get('reverse', '')
			if reverse == '1':
				entries = entries.reverse()
		else:
			entries = LogEntry.objects.order_by('asctime')
		
		paginate_by = 6

		context = paginate(entries, paginate_by, self.request, context, var_name='entries')

		return context

