Django REST Tables
Create dynamic tables with Angular using your Django Rest Framework API.
If you use Django Rest Framework, get a representation of your results dynamic and easy to use and extend. Features include:
Self-construction.
Pagination.
Filter by columns.
Sort by columns.
Change the field representation.
Basic usage
Create a table class including your Django Rest Framework (DRF) ViewSet:
# myapp/api.py
# ------------
class MyTable(Table):
class Meta:
view_set = MymodelViewSet # DRF ViewSet
Add it to your view context:
# myapp/views.py
# --------------
def my_view(request):
return render(request, 'myapp/mytable.html', {'table': MyTable()})
Add it to your template:
{# myapp/templates/myapp/mytable.html #}
{# ---------------------------------- #}
{% load rest_tables %}
{% rest_table table %}
....
<script src="//unpkg.com/angular@1.3.12/angular.min.js" type="text/javascript"></script>
<script src="//unpkg.com/ng-table@3.0.1/bundles/ng-table.min.js" type="text/javascript"></script>
<script src="{% static 'rest_tables/src/js/rest_tables.js' %}" type="text/javascript"></script>
It’s all!
Metadata
Release files for django-rest-tables 0.1.0
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-rest-tables-0.1.0.tar.gz | 6.9 kB | Without provenance | Details for django-rest-tables-0.1.0.tar.gz |
Release files / django-rest-tables-0.1.0.tar.gz
| Download URL | django-rest-tables-0.1.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3a47b8c4a213bab81b561157ce926c87deb2951338083527df9fe6b67ad257e
|
|
BLAKE2b-256 checksum How to use checksums |
c1e382a44412ff6b5cbedbe71c4b1498e37e5a076dd7b9f46d86f73bc79b7a41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-rest-tables 0.1.0
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.