Update README

This commit is contained in:
Florent Lebreton
2013-09-29 12:13:57 +02:00
parent 69e81bd808
commit b87ba745e7

View File

@@ -6,22 +6,27 @@ It provides:
* A model field to store a captured signature; * A model field to store a captured signature;
* A mixin adding two fields (signature / signature_date) in any of your Django models. * A mixin adding two fields (signature / signature_date) in any of your Django models.
.. image:: https://travis-ci.org/fle/django-jsignature.png?branch=master :target: https://travis-ci.org/fle/django-jsignature .. image:: https://travis-ci.org/fle/django-jsignature.png?branch=master
:target: https://travis-ci.org/fle/django-jsignature
================== ==================
INSTALL INSTALL
================== ==================
For now: For now:
:: ::
pip install https://github.com/fle/django-solo/archive/master.zip pip install https://github.com/fle/django-solo/archive/master.zip
================== ==================
USAGE USAGE
================== ==================
* Add ``jsignature`` to your ``INSTALLED_APPS``: * Add ``jsignature`` to your ``INSTALLED_APPS``:
:: ::
# settings.py # settings.py
INSTALLED_APPS = ( INSTALLED_APPS = (
... ...
@@ -31,6 +36,7 @@ USAGE
* Use provided form field and widget: * Use provided form field and widget:
:: ::
# forms.py # forms.py
from django import forms from django import forms
from jsignature.forms import JSignatureField from jsignature.forms import JSignatureField
@@ -41,6 +47,7 @@ USAGE
* Render image after form validation: * Render image after form validation:
:: ::
# views.py # views.py
from jsignature.utils import draw_signature from jsignature.utils import draw_signature
from myapp.forms import SignatureForm from myapp.forms import SignatureForm
@@ -58,10 +65,13 @@ USAGE
================== ==================
CUSTOMIZATION CUSTOMIZATION
================== ==================
JSignature plugin options are available in python: JSignature plugin options are available in python:
* Globally, in your settings: * Globally, in your settings:
:: ::
# settings.py # settings.py
JSIGNATURE_WIDTH = 500 JSIGNATURE_WIDTH = 500
JSIGNATURE_HEIGHT = 200 JSIGNATURE_HEIGHT = 200
@@ -69,6 +79,7 @@ JSignature plugin options are available in python:
* Specifically, in your form: * Specifically, in your form:
:: ::
# forms.py # forms.py
from jsignature.forms import JSignatureField from jsignature.forms import JSignatureField
from jsignature.widgets import JSignatureWidget from jsignature.widgets import JSignatureWidget
@@ -78,9 +89,11 @@ JSignature plugin options are available in python:
================== ==================
IN YOUR MODELS IN YOUR MODELS
================== ==================
If you wan to store signatures, provided mixin gives a `signature` and a `signature_date` that update themselves: If you wan to store signatures, provided mixin gives a `signature` and a `signature_date` that update themselves:
:: ::
from django.db import models from django.db import models
from jsignature.mixins import JSignatureFieldsMixin from jsignature.mixins import JSignatureFieldsMixin