SignCanvasField
Project description
Django Canvas Field
这是一个 Python 模块,为 Django 提供手写签名字段,以及手写签名的网页控件,感谢 jSignatrue 项目为本模块提供支持。
-
安装并注册模块
# pip install django-canvas-field # File: settings.py INSTALLED_APPS = [ "canvas", ]
-
在模型中使用
from canvas.fields import SignCanvasField class Simple(Model): name = CharField(max_length=20, unique=True) sign = SignCanvasField(null=True, blank=True)
-
使用签名控件
from django import forms from canvas.widgets import SignCanvasWidget from .models import Simple class SimpleForm(forms.ModelForm): class Meta: model = Simple widgets = { 'sign': SignCanvasWidget() }
SignCanvasWidget
是 django.forms.widgets.Textarea
的子类,使用自定义的模板 sign_canvas.html
。SignCanvasField
是 django.db.models.TextField
的子类,表单字段指向 SignCanvasWidget
。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-canvas-field-1.0.0.tar.gz
(54.0 kB
view hashes)
Built Distribution
Close
Hashes for django-canvas-field-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f47d294473e957b3424f1466d4709fde5f75a940bb8b4c8d94a29b45262061a |
|
MD5 | b800934304724fb8a467b793dd471223 |
|
BLAKE2b-256 | ad9e01c9648d82eed892c3e01868ccee58fba6857ee7d8e5d945048237aa816f |
Close
Hashes for django_canvas_field-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d889329ce25abaa4b02ccb55f19160ab82d59c772c2397ce3e8582def17b37c9 |
|
MD5 | 5c78474f62770c2dc33fc299fb1f961d |
|
BLAKE2b-256 | 14d2443d805b3a667380491605c8a680691f9f1001d30a93cc1b8ef715e8e383 |