Skip to main content

Simple Python-Tabulate mixin for Django QuerySets.

Project description

=====
Django Tabulate
=====

Django Tabulate is a simple Django app on top of Python tabulate, but for querysets.

Quick start
-----------

1. Install django-tabulate from pip::

pip install django-tabulate

2. Lets your QuerySet Inherit from `TabulateMixin` or `TabulateQuerySet`:

from django_tabulate import TabulateMixin

class MyQuerySet(TabulateMixin, models.QuerySet):
#...

class MyModel(models.Model):
#...

objects = MyQuerySet.as_manager()
#if we have a manager, then
objects = MyManager.from_queryset(MyQuerySet)()

4. Start the python shell

python manage.py shell

5. Tabulate a QuerySet

from myapp.models import MyModel
print MyModel.objects.all().tabulate()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-tabulate-0.1.zip (7.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page