Skip to main content

A Django fitemplate field twith managers to return the rendered or unrendered template.

Project description

https://badge.fury.io/py/django-template-field.png https://travis-ci.org/orcasgit/django-template-field.png?branch=master

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

django-template-field-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

django_template_field-0.1.0-py2.py3-none-any.whl (6.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-template-field-0.1.0.tar.gz.

File metadata

File hashes

Hashes for django-template-field-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6cbe10cf1cd4dda4819a7341f99db7b1c4022ff1a69c059289afa9d105915a5e
MD5 0307ee95096cdb9425235392a3db8855
BLAKE2b-256 1cdb58d925fa9288488aea598fe0f11f3ed57c39d9c46e12933431d02845979a

See more details on using hashes here.

Provenance

File details

Details for the file django_template_field-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_template_field-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f1b4adb9dff0ad2b3cdc2a29e9f614c09168f8bf723c6babf5cabeb0103be766
MD5 4307c7a0f816a22306ee0d2f319cbbd9
BLAKE2b-256 59ba8842d64d327c49d2ac853710280cab895b33ec32a59207c9a275ec9e1dd4

See more details on using hashes here.

Provenance

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