SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
AutoForms
                  A custom form engine for Django




@jeff_kit
http://jeffkit.info
AutoForms is ...

• A custom form engine for django
• Django Form ++
• Declare form at runtime
• Form serialization
• http://autoforms.sandbox.jeffkit.info
Who needs AutoForms

• Polling
• information collecting
• custom form in workflow
• a dynamic form in your Django app
• PAAS made in china
You may seen her before
How to ...
installation

• git clone git://github.com/jeffkit/autoforms
• cd autoforms
• python setup.py install
config ur Django project
• Append ‘autoforms’ to INSTALL_APPS in
  settings.py
• Append “(r'^form/', include('autoforms.urls'))”
  to urlpatterns in urls.py
• python manage.py syncdb
• And ....... Rock n’ Roll it !
Form Administration
Create a Form
Supported field types
Preview the form
Preview the form




           How?
ADV Field setting

• default value,datasource,validator......
• Custom Field Widget
• Custom Error message
Advantage setting
Advantage


   Text
Advantage

   Supported Widget types
   Text
Widget Parameters
Widget Parameters

           json string
Widget Parameters

            json string




   gly !!
  U
Widget Parameters

                      json string




   gly !!
  U         to be change ......
Custom error message
Custom error message
Custom error message
Custom error message
Collecting form data


• fill a form @ form/fill/{form-id}/
• overview data @ form/overview/{form-id}/
Code Code Code

• OK here comes the high level API
• First of all:
 • from autoforms.models import Form
Get a Form
• Empty Form
 • form = Form.objects.get(pk=id).as_form()
• Form with data
 • data = request.POST
 • form = Form.objects.get(pk=id).as_form(data)
• ‘form’ could be a django.forms.Form object!
render a form

• form.as_p()
• form.as_table()
• form.as_ul()
• That’s the regular Django Form api!
Save form data


• data = request.POST
• form.persist(data)
Load stored form datas


• datas = form.search(page,size,fields,*args,**kw)
Play with datas

• for data in datas:
 • print data.name,data.email,data.message
• ‘data’ is an instance of
  autoforms.models.FormInstance
A fancy tag

• {% datalist page=1 pagesize=10
  fields=name,email template=your-app/your-
  template.html %}
• Diaplay your form data in a table.
• All parameters are optional !
Sth u can do with autoforms
Poll/Collecting service

• TODOs:
 • A nice form style
 • An Embedable (iframe ) form page
 • Simple statis logic and charts
Form storage service

• TODOs:
 • A better form data storage backend
 • A Pice of javascript code
PAAS made in China?!

• a Form is a model
• develop on line with “form + script”
• ok,it’s just a joke :P
TODO

• i18N
• custom widget
• save the files
• a MongoDB form data storage backend
• custom validator
Questions?
Thank you!

Mais conteúdo relacionado

Semelhante a Autoforms

GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
Yared Ayalew
 
Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001
Fred Meng
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
Kiril Iliev
 

Semelhante a Autoforms (20)

GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
 
django Forms in a Web API World
django Forms in a Web API Worlddjango Forms in a Web API World
django Forms in a Web API World
 
Hexagonal Design - Maarten van Schaik
Hexagonal Design - Maarten van SchaikHexagonal Design - Maarten van Schaik
Hexagonal Design - Maarten van Schaik
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Quick & Easy SharePoint Forms with StratusForms
Quick & Easy SharePoint Forms with StratusFormsQuick & Easy SharePoint Forms with StratusForms
Quick & Easy SharePoint Forms with StratusForms
 
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Araport Workshop Tutorial 2: Authentication and the Agave Profiles ServiceAraport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Service
 
SharePoint goes Microsoft Graph
SharePoint goes Microsoft GraphSharePoint goes Microsoft Graph
SharePoint goes Microsoft Graph
 
Forge - DevCon 2016: Introduction to Forge 3D Print API Through Sample Applic...
Forge - DevCon 2016: Introduction to Forge 3D Print API Through Sample Applic...Forge - DevCon 2016: Introduction to Forge 3D Print API Through Sample Applic...
Forge - DevCon 2016: Introduction to Forge 3D Print API Through Sample Applic...
 
SharePoint 2013 APIs demystified
SharePoint 2013 APIs demystifiedSharePoint 2013 APIs demystified
SharePoint 2013 APIs demystified
 
Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001
 
SAP Adobe forms
SAP Adobe formsSAP Adobe forms
SAP Adobe forms
 
Forge - DevCon 2016: Free your BIM data
Forge - DevCon 2016: Free your BIM dataForge - DevCon 2016: Free your BIM data
Forge - DevCon 2016: Free your BIM data
 
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 Harness SharePoint and jQuery to Make Dynamic Displays and Applications Harness SharePoint and jQuery to Make Dynamic Displays and Applications
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 
SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuery
 
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
 
Y Boss External 20091017
Y Boss External 20091017Y Boss External 20091017
Y Boss External 20091017
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
 
Session 03 acquiring data
Session 03 acquiring dataSession 03 acquiring data
Session 03 acquiring data
 
Session 03 acquiring data
Session 03 acquiring dataSession 03 acquiring data
Session 03 acquiring data
 
HTML5 Form Validation
HTML5 Form ValidationHTML5 Form Validation
HTML5 Form Validation
 

Mais de jeff kit (10)

构建稳健的iOS推送服务
构建稳健的iOS推送服务构建稳健的iOS推送服务
构建稳健的iOS推送服务
 
Taste Rabbitmq
Taste RabbitmqTaste Rabbitmq
Taste Rabbitmq
 
冲浪 Object-c
冲浪 Object-c冲浪 Object-c
冲浪 Object-c
 
给Geek们的音乐课
给Geek们的音乐课给Geek们的音乐课
给Geek们的音乐课
 
漫游iOS开发指南
漫游iOS开发指南漫游iOS开发指南
漫游iOS开发指南
 
原创音乐会
原创音乐会原创音乐会
原创音乐会
 
杯具是怎样练成的
杯具是怎样练成的杯具是怎样练成的
杯具是怎样练成的
 
Bi
BiBi
Bi
 
Git
GitGit
Git
 
Brief intro of Dropbox
Brief intro of DropboxBrief intro of Dropbox
Brief intro of Dropbox
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Autoforms