Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

YAFOWIL - Webformulare in Python ohne Kopfschmerzen

2,073 views

Published on

Published in: Health & Medicine, Technology
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

YAFOWIL - Webformulare in Python ohne Kopfschmerzen

  1. 1. Plone Konferenz München 2012 YAFOWIL (Yet Another FOrm Widget Library) Webformulare ohne Kopfschmerzen Jens W. Klein <jk@kleinundpartner.at> 23.02. 2012
  2. 2. Der Leidensdruck <ul><li>„I feel like a stupid beginner while doing a simple z3cform“
  3. 3. Forms werden doppelt verarbeitet: Validierung und Wertumwandlung
  4. 4. Ich will keine Interfaces und Klassen schreiben müssen um Formulare zu bauen.
  5. 5. Ich will Formulare zur Laufzeit verändern können.
  6. 6. Ich will Formulare in Pyramid und Plone gleich erstellen können. </li></ul>
  7. 7. Designkriterien <ul><li>Form-Widgets sind eine Datenstruktur
  8. 8. Formulare werden deklarativ erstellt.
  9. 9. Formulare sind nicht zwingend Python Code
  10. 10. Validierung und Wertumwandlung sind Eins
  11. 11. Widgets sollen flexibel zusammengebaut werden und einfach funktional erweitert weren können
  12. 12. Man muss kein Python Guru sein um Forms erstellen zu können. </li></ul>
  13. 13. from yafowil import factory form = factory('form', name='helloworld', props={'action': url}) form['person'] = factory('#stringfield', props={'label': 'Who?', 'value': '', 'required': True}) form['submit'] = factory('field:submit', props={'label': 'greet', 'action': 'save', 'handler': store , 'next': next })
  14. 14. factory: form name: soundcloudsettings props: action: expr:context.action class: edit-form enableUnloadProtection widgets: - client_id: factory: field:label:error:text value: expr:context.settings.client_id props: label: Client Id required: Client Id needed.
  15. 15. - client_secret: factory: field:label:error:text value: expr:context.settings.client_secret props: label: Client Secret required: Client Secret needed. - save: factory: submit props: action: save expression: True handler: context.save next: context.next label: Save
  16. 16. import yafowil.loader def store (widget, data): with open('storage.txt', 'a') ad f: f.write(data['person']) def next (widget, data): return 'http://some.where.org/nextpage'
  17. 17. from yafowil import Controller controller = Controller(form, request) if not controller.next: return redirect (controller.next) return controller.rendered
  18. 19. Prinzipien <ul><li>Runtime rules, static is subordinate,
  19. 20. Don’t mess with a framework,
  20. 21. Keep it simple and pythonic,
  21. 22. No fights with storage,
  22. 23. Use chains and trees as structures. </li></ul>
  23. 24. Quellen <ul><li>Software-Paket http://pypi.python.org/pypi/yafowil
  24. 25. Dokumentation http://yafowil.info
  25. 26. Beispiel: Plone Custom Search http://plone.org/documentation/kb/build-a-custom-search-form-with-yafowil </li></ul>

×