You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
510 B
Python
23 lines
510 B
Python
from django.views.generic import DetailView, ListView
|
|
|
|
from nano.badge.models import Badge
|
|
|
|
|
|
class BadgeMixin(object):
|
|
queryset = Badge.objects.all()
|
|
|
|
def get_context_data(self, **kwargs):
|
|
context = super(BadgeMixin, self).get_context_data(**kwargs)
|
|
context['me'] = 'badge'
|
|
return context
|
|
|
|
|
|
class ListBadgeView(BadgeMixin, ListView):
|
|
pass
|
|
list_badges = ListBadgeView.as_view()
|
|
|
|
|
|
class DetailBadgeView(BadgeMixin, DetailView):
|
|
pass
|
|
show_badge = DetailBadgeView.as_view()
|