Skip to main content

django-legaltext helps to manage legal text versioning.

Project description

Latest PyPI version Latest Travis CI build status

Legaltext is a Django application to help managing legal text versioning (e.g. terms of condition, pr privacy policy). It also supports versioning of the corresponding checkbox labels.

Features

The application consists of multiple parts and helpers:

  • Models to maintain legal texts, their versions and checkboxes

  • Model field to store the accepted version of a legal text (with support to auto-fetched default of current version)

  • Form field to render the widget which outputs the configured checkboxes just using the legal text slug

  • Admin interface to maintain the legal texts, adding new version with prefilling

Installation

requirements.txt

Just add the following PyPI package to your requirements.txt

django-legaltext

settings.py

To activate the application, add the following two packages to your INSTALLED_APPS

INSTALLED_APPS = (
    ...
    'floppyforms',  # needed for widget rendering
    'markymark',  # required for markdown rendering
    'legaltext',
)

urls.py

To register the url to output the legal texts, add the following to your urls.py.

urlpatterns = [
    ...
    url(r'^legaltext/', include('legaltext.urls')),
]

Usage

Please refer to the examples to learn how to use the application.

You just need to add a new model field to your models and set the correct formfield in the corresponding forms.

class YourModel(models.Model):
    ...

    accepted_legaltext = LegalTextField('some-unique-slug')
class YourForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.fields['accepted_legaltext'] = LegalTextFormField('some-unique-slug')

Make sure that you use the same slug on both (model and form) field.

Customization

There are some more settings you can set to change the applcation

  • LEGALTEXT_ANCHOR_CLASS Add an additional css class the the rendered anchor-span when using [anchor:foo]

  • LEGALTEXT_VIEW_TEMPLATE Change the template which is used to in the view to output the legal text

  • LEGALTEXT_VIEW_TEMPLATE_OVERRIDES Choose a different template to use in views for specific slugs

  • LEGALTEXT_WIDGET_TEMPLATE Change the template which is used to in the widget to output the checkboxes

  • LEGALTEXT_WIDGET_TEMPLATE_OVERRIDES Choose a different template to use in widget for specific slugs

  • LEGALTEXT_WIDGET_ATTRS Add extra attributes to checkbox input elements

Resources

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-legaltext-0.2.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

django_legaltext-0.2.1-py2.py3-none-any.whl (17.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-legaltext-0.2.1.tar.gz.

File metadata

File hashes

Hashes for django-legaltext-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a5df7bddccd768f05705afd93fb0afbbfec6c0ecc9b1dbcb571ff756b37ac5c4
MD5 943e21a0ddfcb5cc89e07f6271e239c5
BLAKE2b-256 70398d4ae11f1f7410bd33a9621b8ae3bb9f1fc00456002919c05772dff87ec7

See more details on using hashes here.

File details

Details for the file django_legaltext-0.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_legaltext-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 47b67e22ef442d8045bf1fd390e6b1282a222b0b02f3548285ce700cbfab448e
MD5 c97f2a30b6e40dc78f6cc60dd8a18545
BLAKE2b-256 12d2c3b2ed9fd7382c6726c6d7130464afdd156b9db267e1f7be5961c8476638

See more details on using hashes here.

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