semvec/pypi-packages huggingface dataset:
django-validatorchain 0.1
Helper for making form validators skippable
License: BSD

django-validatorchain
#####################


Motivation
==========

While working on the EuroPython 2014 website we ran into a situation where we
had a field validator that was rather expensive to evaluate.

Sadly, the `validators-attribute`_ on a model/form field is always evaluated as
a whole (meaning each validator in that list is executed no matter if a previous
one errored out already). So, we wanted to have a way to mark certain validators
as not to be executed in case the field was being marked as invalid anyway.

We still wanted to use the field validator API simply because it keeps
everything easily testible, though.


How to use
==========

::

    from django.db import models

    from validatorchain import ValidatorChain

    from .validators import a_cheap_validator
    from .validators import another_cheap_validator
    from .validators import an_expensive_validator


    class SomeModel(models.Model):
        field = models.CharField(
            max_length=100,
            validators=ValidatorChain()
                .add(a_cheap_validator)
                .add(an_expensive_validator, skip_on_error=True)
                .add(another_cheap_validator)
            )

This way `an_expensive_validator` will not be executed if `a_cheap_validator`
already raised an exception, while `another_cheap_validator` will be executed
again.


.. _validators-attribute: https://docs.djangoproject.com/en/1.5/ref/forms/validation/#validators
Flask-Turbolinks 0.2.0
Turbolinks for Flask.
License: BSD

Flask-Turbolinks
================

.. image:: https://travis-ci.org/lepture/flask-turbolinks.png?branch=master
        :target: https://travis-ci.org/lepture/flask-turbolinks
.. image:: https://coveralls.io/repos/lepture/flask-turbolinks/badge.png?branch=master
        :target: https://coveralls.io/r/lepture/flask-turbolinks

Turbolinks for Flask.


Turbolinks
----------

Turbolinks makes following links in your web application faster. For more
information, visit the original rails repo: `turbolinks.js`_.


Installation
------------

To install Flask-Turbolinks, simply::

    $ pip install Flask-Turbolinks

Or alternatively if you don't have pip::

    $ easy_install Flask-Turbolinks


Usage
-----

To enable turbolinks, you need to put `turbolinks.js`_ in the ``<head>`` of
your html templates.


The backend flask app should be wrapped with turbolinks::

    from flask import Flask
    from flask_turbolinks import turbolinks

    app = Flask(__name__)
    # you app should has a secret key for session
    app.secret_key = 'secret'

    turbolinks(app)

And everything works now, no more configuration.

.. _`turbolinks.js`: https://github.com/rails/turbolinks


Note
----

You can install the javascript code with component::

    $ component install lepture/flask-turbolinks

You can also grab the code from `turbolinks.js` on GitHub. It is written in CoffeeScript, you can compile it with::

    coffee -c turbolinks.js.coffee


Demo
----

There is a demo in the ``example`` directory, start a server and open the
url with Chrome. View the requests with developer tools of Chrome.


Credits
-------

Thanks for rails, thanks for the help of Rei_.

.. _Rei: https://github.com/chloerei


Changelog
---------

We keep the changelog on `GitHub releases`_.

.. _`GitHub releases`: https://github.com/lepture/flask-turbolinks/releases