.. |...| unicode:: U+2026 .. ellipsis
===================
Dynamically add forms to your site through the admin interface.
With django-dynamicforms you can:
pip install django-dynamicforms
'dynamicforms'
to your INSTALLED_APPS
(r'^dynamicforms/', include('dynamicforms.urls'))
to your urls.py
django >= 1.3
, html2text
There are two optional settings: DYNAMICFORM_TYPES
and DYNAMICFIELD_TYPES
, which define custom form and field types respectively. For example::
DYNAMICFORM_TYPES = {
'newsletter-subscription': {
'VERBOSE_NAME': 'Newsletter subscription',
'BASE_FORM': 'newsletters.forms.SubscriptionForm',
'SUCCESS_URL': '/newsletter/thanks/',
'TEMPLATE': 'dynamicforms/form.html',
'TAG_TEMPLATE': 'dynamicforms/_form.html',
'EMAIL_TEMPLATE': 'dynamicforms/notification.html',
},
}
DYNAMICFIELD_TYPES = {
'phone': {
'VERBOSE_NAME': 'Phone number',
'FIELD': 'phone.forms.PhoneField',
'HAS_CHOICES': False,
'DEFAULT': '',
'WIDGET': 'django.forms.TextInput'
},
}
Response e-mails are sent from settings.DEFAULT_FROM_EMAIL
.
Notification e-mails are sent from settings.SERVER_EMAIL
.
Every form has its own page, but can also be included in other pages with::
{% load dynamicform_tags %}
...
{% show_dynamicform %}
It will always post to its own url, though, and validation errors will have to be corrected there.
The templates used to render dynamicforms can be overridden by custom form types, but default to:
dynamicforms/form.html
for the form urldynamicforms/_form.html
for the template tagdynamicforms/notification.eml
for the notification e-mail.. vim: ft=rst
Version | Tag | Published |
---|---|---|
0.1.2 | 11yrs ago | |
0.1.1 | 11yrs ago | |
0.1 | 11yrs ago |