Django-Lazyloader
=====
Django-Lazyloader is a simple Django app which helps displaying Django objects as either HTML or JSON.
Quick start
-----------
1. Add "lazyloader" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'lazyloader',
)
2. Include the lazyloader URLconf in your project urls.py like this::
url(r'^lazyloader/', include('lazyloader.urls')),
3. Run `python manage.py migrate` to create the demo models.
4. Run `python manage.py loaddata lazyloader_initial.json` to load the initial data for the live demo.
5. Run `python manage.py collectstatic` to collect the static files of the live demo.
6. To allow your models to be displayed by Django-Lazyloader, define a VALID_LAZY_MODELS variable in your settings.py
file like this::
VALID_LAZY_MODELS = [
'MyApp.MyModel',
'MyOtherApp.MyOtherModel',
]
7. Create html templates and assign them to your models by adding a LAZY_TEMPLATES variable to your project's
settings.py file like this::
LAZY_TEMPLATES = {
'MyApp.MyModel': 'myapp/mylazytemplate.html',
'MyOtherApp.MyOtherModel': 'myotherapp/myotherlazytemplate.html'
}
8. Run the development server and visit http://localhost:8000/lazyloader/demo for the live demo.
9. To access your the first 10 entries of your model 'Myapp.MyModel' in the JSON format visit
http://localhost:8000/lazyloader/myapp-mymodel-json-0-10/
10. To access your the first 10 entries of your model 'Myapp.MyModel' in the HTML format visit
http://localhost:8000/lazyloader/myapp-mymodel-html-0-10/
11. To create custom queries you can add the get parameters 'column' and 'search_value' to your url:
http://localhost:8000/lazyloader/myapp-mymodel-html-0-10/?column=name&search_value=smith
This url will execute a django-query that looks like this::
MyApp.MyModel.objects.filter(name=smith)
12. The variable that is passed to the templates is called 'models' so if you want to iterate over the queryset in a
template you have to do it like this::
{% for model in models %}
{{ model.fieldname }}
{% endfor %}
Metadata
Release files for django-lazyloader 0.2
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 | |
|---|---|---|---|---|
| django-lazyloader-0.2.tar.gz | 40.9 kB | Without provenance | Details |
Release files / django-lazyloader-0.2.tar.gz
| Download URL | django-lazyloader-0.2.tar.gz |
|---|---|
| Size | 40.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
243d011adfff759c3f7a2a11f0e0861966b7dacfdc7451ebc9c8ca77d33dc034
|
|
BLAKE2b-256 checksum How to use checksums |
6d3f79fec93303772a7637b20e294739fda00e206a7ca2db183e33164056841d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-lazyloader 0.2
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.