def show_options_list(self, list, page=1, per_page=25):

        from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
        paginator = Paginator(list, per_page) # Show 25 options per page

        try:
            options = paginator.page(page)
        except PageNotAnInteger:
            # If page is not an integer, deliver first page.
            options = paginator.page(1)
        except EmptyPage:
            # If page is out of range (e.g. 9999), deliver last page of results.
            options = paginator.page(paginator.num_pages)

        x = PrettyTable(["Site", "Option", "Last change", "Created at", "Value", "Autoload"])
        x.align["Option"] = "l"
        x.align["Value"] = "l"

        for opt in options:
            x.add_row([opt.site.pk, opt.key, opt.updated_at.strftime("%Y-%m-%d %H:%M:%S"), opt.created_at.strftime("%Y-%m-%d %H:%M:%S"), force_unicode(opt.value), opt.autoload])

        self.stdout.write(u"\n%s" % x)

        if page and paginator.num_pages > 1:
            self.stdout.write(u'\nPage %s of %s' % (page,paginator.num_pages))
dataset/ETHPy150Open joke2k/django-options/django_options/management/commands/options.py/Command.show_options_list/original