Your SlideShare is downloading. ×
0
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Amsterdam PUN - 20-10-2011
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Amsterdam PUN - 20-10-2011

884

Published on

Presentation of collective.autosaveform at PUN (Python Users Netherlands)

Presentation of collective.autosaveform at PUN (Python Users Netherlands)

Published in: Technology, Travel
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
884
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. collective.autosaveform Vincent Pretre - Zest software PUN 20/10/11 - AmsterdamFriday, October 21, 2011
  • 2. Friday, October 21, 2011
  • 3. Friday, October 21, 2011
  • 4. Friday, October 21, 2011
  • 5. Friday, October 21, 2011
  • 6. Friday, October 21, 2011
  • 7. Saving events • Input changed • User clicks • User (or user’s cat) hits key • Every x secondsFriday, October 21, 2011
  • 8. Saving form - local • Use localstorage • Fake dictionaries [my_form][an_input] = ’10’ [my_form][multi_input][count] = ‘2’ [my_form][multi_input][values][0] = ‘bli’ [my_form][multi_input][values][1] = ‘bla’Friday, October 21, 2011
  • 9. Saving form - remote • Every 10 local saves • jQuery Ajax call • data saved as annotations in portal_autosaveform [my_form][an_input] = ’10’ [my_form][multi_input][values] = [‘bli’, ‘bla’]Friday, October 21, 2011
  • 10. Loading form • compare local/remote database versions • use most recent • fills the form with saved dataFriday, October 21, 2011
  • 11. Using autosave form 1 - register form from collective.autosaveform import config from Products.CMFCore.utils import getToolByName tool = getToolByName(context, portal_autosaveform) try: tool.register_form(my_saved_form, {text_field: config.TEXT, radio_field: config.RADIO}) except: passFriday, October 21, 2011
  • 12. Using autosave form 2 - enable loading <script type="text/javascript"> jq(#my_saved_form).autosaveform(); </script>Friday, October 21, 2011
  • 13. Using autosave form 3 - mark form def process_form(...): # Process the form ... tool = getToolByName(context, portal_autosaveform tool.mark_form_processed( my_saved_form)Friday, October 21, 2011
  • 14. DemoFriday, October 21, 2011
  • 15. Limitations • Only works with logged-in users • Only tested with custom forms (no Archetypes forms or z3cforms) • Do not support file inputsFriday, October 21, 2011
  • 16. Advantages • Configurable • Server friendly • User friendly • Multi-browsers • Supports all HTML inputsFriday, October 21, 2011

×