Django Tabulate
=====
Django Tabulate is a simple app on top of Python tabulate, but for Django querysets.
It allows us to to Pretty-print Django QuerySets
Requirements
------------
* **Python**: 2.7, 3.5
* **Django**: 1.8, 1.11
* **tabulate**: 0.8.1
Tested on these, but should still work on all actively supported Python and Django versions.
Installation
------------
Install using pip:
.. code-block:: sh
pip install django-tabulate
Usage
-----
You can use it as a function:
.. code-block:: python
from myapp.models import MyModel
from django_tabulate import tabulate_qs
print tabulate_qs(MyModel.objects.all())
+------+----------+
| id | name |
|------+----------|
| 1 | Python |
| 2 | Django |
| 3 | Tabulate |
+------+----------+
Or as a QuerySet mixin:
.. code-block:: python
#models.py
from django.db import models
from django_tabulate import TabulateMixin
class MyModelQuerySet(models.QuerySet, TabulateMixin):
pass
class MyModel(models.Model):
name = models.CharField(max_length=255)
objects = MyModelQuerySet.as_manager()
#then in the shell
from myapp.models import MyModel
print MyModel.objects.all().tabulate()
Settings
-----------
You can override all default tabulate settings via `TABULATE_DEFAULTS`
.. code-block:: python
TABULATE_DEFAULTS = {
'tablefmt': 'psql'
}
For a complete list of all tabulate options take a look at
https://bitbucket.org/astanin/python-tabulate/overview
Metadata
Release files for django-tabulate 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-tabulate-0.1.1.zip | 8.5 kB | Without provenance | Details for django-tabulate-0.1.1.zip |
Release files / django-tabulate-0.1.1.zip
| Download URL | django-tabulate-0.1.1.zip |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fe09eda2979c691eb1b8ff3bdc8350f485ef9776f49881482da022412f09336
|
|
BLAKE2b-256 checksum How to use checksums |
af00b61a9c48f5acaf40ed3e4df52c5274bce08daa3abbddb46472747d5910f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-tabulate 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.