Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thurloat/django-dojo-toolkit

Dojo forms toolkit for django forms
https://github.com/thurloat/django-dojo-toolkit

Last synced: 9 days ago
JSON representation

Dojo forms toolkit for django forms

Awesome Lists containing this project

README

        

# Django Dojo Toolkit #

This is our implementation of Various Dojo Dijit Widgets and Dojo Forms.

# Sample Usage #

in forms.py:

from django import forms
from dojotoolkit.forms import DojoForm
from dojotoolkit.widgets import DojoDateWidget, DojoValidatingTextWidget, DojoSelectWidget

class FooForm(DojoForm):
name = forms.CharField(widget = DojoValidatingTextWidget("[a-zA-Z ]+", required=True, invalid_message="don't use numbers"))

def save(self):
#save your model using self.cleaned_data
return instance

in your template:

{% extends "base.html" %}
{% block preload_js %}
{{ form.get_dojo_js }}
{% endblock %}
{% block content %}


{{ form.as_table }}

{{ form.get_submit_button }}

{% endblock %}

# Additional Notes #

- Call Adam or Sam!