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

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.1.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

django_legaltext-0.1.0-py2.py3-none-any.whl (16.6 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for django-legaltext-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e77d88177a39273093315336502c59e09e684cdbcd81a13dbd3df5228e217759
MD5 9704aeae4c6bd7df5493c69ba046793e
BLAKE2b-256 a3c0d055f6ebfcf0c71222d03d17502761460ff513958e0cf1d83b23be3a0d18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_legaltext-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b2257dffa4a9666ea349154e2c5ac5a9f89a9478883e60b02c06f484279984c8
MD5 1a556c40a1a44c3be0ae276d1de877ed
BLAKE2b-256 632052b02783cbb7054e2cd613a142cc79a9d0ece738500fb542de2b2d8179a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page