A Django fitemplate field twith managers to return the rendered or unrendered template.
Project description
A Django template field with a manager to return the rendered template.
Documentation
The full documentation is at https://django-template-field.readthedocs.org.
Quickstart
Install django-template-field:
pip install django-template-field
Then use it in a project:
from django.db import models from templatefield import fields, managers class TemplatedText(models.Model): value = fields.TemplateTextField() # Manger that returns rendered templates. objects_rendered = managers.RenderTemplateManager() # Django's default manager returns unrendered templates. objects_unrendered = models.Manager()
Extra context can be added in settings like so:
TEMPLATE_FIELD_CONTEXT = { ‘template_var’: value }
Running Tests
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install -r requirements-test.txt (myenv) $ python runtests.py
History
0.1.0 (2015-10-02)
First release on PyPI.
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
Built Distribution
File details
Details for the file django-template-field-0.1.0.tar.gz
.
File metadata
- Download URL: django-template-field-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cbe10cf1cd4dda4819a7341f99db7b1c4022ff1a69c059289afa9d105915a5e |
|
MD5 | 0307ee95096cdb9425235392a3db8855 |
|
BLAKE2b-256 | 1cdb58d925fa9288488aea598fe0f11f3ed57c39d9c46e12933431d02845979a |
Provenance
File details
Details for the file django_template_field-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_template_field-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1b4adb9dff0ad2b3cdc2a29e9f614c09168f8bf723c6babf5cabeb0103be766 |
|
MD5 | 4307c7a0f816a22306ee0d2f319cbbd9 |
|
BLAKE2b-256 | 59ba8842d64d327c49d2ac853710280cab895b33ec32a59207c9a275ec9e1dd4 |