PloneConf2011 - How to build ERP application while having fun

  • 3,707 views
Uploaded on

 

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
3,707
On Slideshare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
138
Comments
2
Likes
12

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. How to build complexweb applications having fun?
  • 2. How to build complexweb applications having fun?
  • 3. author Andrew Mleczko Software Integrator Ferrara (Italy) amleczko amleczko@redturtle.it
  • 4. author Andrew Mleczko Software Integrator Ferrara (Italy) amleczko amleczko@redturtle.it
  • 5. author Ferrara Andrew Mleczko Software Integrator Ferrara (Italy) amleczko amleczko@redturtle.it
  • 6. the team
  • 7. the team
  • 8. WHY this talk?
  • 9. My Reasons to be here★ Building complex web applications should be fun★ to promote
  • 10. SMALL “Roughly 5000 lines of code”
  • 11. SMALL “Roughly 5000 lines of code”FAST
  • 12. SMALL “Roughly 5000 lines of code”FASTSTABLE
  • 13. SMALL “Roughly 5000 lines of code”FAST “100% statementSTABLE coverage via unit andTESTED integration tests”
  • 14. SMALL “Roughly 5000 lines of code”FAST “100% statementSTABLE coverage via unit andTESTED integration tests”DOCUMENTED “Literally nothing in Pyramid is undocumented”
  • 15. ★ Debug Toolbar★ Flexible authentication and authorization★ Tweens - a bit like WSGI middleware
  • 16. ★ Decorator-based configurationfrom pyramid.view import view_configfrom pyramid.response import Response@view_config(route_name=fred)def fred_view(request): return Response(fred)
  • 17. ★ Event system (based on ZCA)from pyramid.events import NewRequestfrom pyramid.events import subscriber@subscriber(NewRequest)def mysubscriber(event): event.request.foo = 1
  • 18. ★ Extendable configurationfrom pyramid.config import Configuratorif __name__ == __main__: config = Configurator() config.include(pyramid_formalchemy)
  • 19. the project
  • 20. The Customer★ .★ Born as a startup★ Offices in US
  • 21. Water today★ U.S. - the largest consumer market for bottled water in the world★ in 2011, the market is forecast to have a value of $86,421.2 billion “Bottled water has become the second largest commercial beverage category”
  • 22. project requirements
  • 23. paperless sale
  • 24. paperless sale Sales E-commerce1 2 3 4 5 CRM Warehouse Support
  • 25. paperless sale1 CRM2 Sales3 Warehouse4 E-commerce5 Support
  • 26. paperless sale1 CRM2 Sales3 Warehouse4 E-commerce5 Support
  • 27. paperless sale1 CRM ★ Customer’s management (satisfaction, order status, etc.)2 Sales ★ Reports (machine statistics, etc.)3 Warehouse ★ Campaigns4 E-commerce5 Support
  • 28. paperless sale1 CRM ★ Sales network management ★ Invoicing / accountancy2 Sales ★ Revenue counter3 Warehouse ★ Discount management4 E-commerce5 Support
  • 29. paperless sale1 CRM ★ Catalog management ★ Warehouse management2 Sales ★ Logistic tracking3 Warehouse4 E-commerce5 Support
  • 30. paperless sale1 CRM ★ Online shop (for beverages and accessories)2 Sales ★ Machine configurator (interactive wizard)3 Warehouse ★ Online payments4 E-commerce5 Support
  • 31. paperless sale1 CRM ★ Machine maintenance (filter change)2 Sales ★ Emergency services ★ Order / installation process3 Warehouse4 E-commerce5 Support
  • 32. paperless sale1 CRM ★ Machine maintenance (filter change)2 Sales ★ Emergency services ★ Order / installation process3 Warehouse4 E-commerce5 Support
  • 33. paperless sale Warehouse Support CRM E-commerce Sales
  • 34. paperless sale Intranet Extranet Warehouse Support CRM E-commerce Sales
  • 35. Totally paperless ERP
  • 36. project gotchas
  • 37. project gotchas★ Requirements are not rock solid (it’s a startup) - project will grow with the customer★ Customer is in U.S. - planning regular meetings is essential★ We need to find new framework for ERP part★ Only 5 months to delivery
  • 38. Arc hi t e ct u ral dec i si ons
  • 39. and
  • 40. and
  • 41. why ?★ architecture is not so far away from Zope★ it supports SQLAlchemy out of the box★ great documentation and active community★ add’s some fresh air to your architecture
  • 42. why ?★ pyramid_formalchemy CRUD★ easy pluggable widgets ★ Multi-upload ★ Metric units ★ Autocomplete ★ Multi-relation★ 75% jQuery code
  • 43. why ?★ pyramid_formalchemy CRUD★ easy pluggable widgets ★ Multi-upload ★ Metric units ★ Autocomplete ★ Multi-relation★ 75% jQuery code
  • 44. why ?★ pyramid_formalchemy CRUD★ easy pluggable widgets ★ Multi-upload ★ Metric units ★ Autocomplete ★ Multi-relation★ 75% jQuery code
  • 45. and ?★ The Best CMS ever★ easy to integrate with other Python frameworks★ almost 2000 addons
  • 46. and ?★ The Best CMS ever★ easy to integrate with other Python frameworks★ almost 2000 addons ★ Diazo (plone.app.theming) ★ Poi ★ PAS (PluggableAuthService)
  • 47. and ?★ The Best CMS ever★ easy to integrate with other Python frameworks★ almost 2000 addons ★ Diazo (plone.app.theming) ★ Poi ★ PAS (PluggableAuthService)
  • 48. and ?★ The Best CMS ever★ easy to integrate with other Python frameworks★ almost 2000 addons ★ Diazo (plone.app.theming) ★ Poi ★ PAS (PluggableAuthService)
  • 49. and ?★ The Best CMS ever★ easy to integrate with other Python frameworks★ almost 2000 addons ★ Diazo (plone.app.theming) ★ Poi ★ PAS (PluggableAuthService)
  • 50. and ?★ The Best CMS ever★ easy to integrate with other Python frameworks★ almost 2000 addons ★ Diazo (plone.app.theming) ★ Poi ★ PAS (PluggableAuthService)
  • 51. I nt eg r at i o n
  • 52. SQL A lchemy
  • 53. SQL A lchemy aeterna.models PostgreSQL
  • 54. authentication - authorization
  • 55. authentication - authorization auth storage Request pas.plugins.sa repoze.who PostgreSQL
  • 56. authentication - authorization auth storage ★ users ★ groups ★ roles PostgreSQL
  • 57. authentication - authorization auth storage single-sign-on ★ users ★ plone.session ★ repoze.who.plugins.auth_tkt ★ groups ★ roles mod_auth_tkt PostgreSQL
  • 58. buildout[intranet-plone]recipe = plone.recipe.zope2instanceeggs = ${intranet-plone:eggs} aeterna.models[intranet-pyramid]recipe = zc.recipe.eggeggs = ${intranet-pyramid:eggs} aeterna.models
  • 59. The big picture pas.plugins. sa ZODBApache beaker PostgreSQL repoze. who
  • 60. The big picture extranet pas.plugins. sa ZODBApache beaker PostgreSQL intranet repoze. who
  • 61. why not o t h er c o mpet i t o rs?
  • 62. d j ang o : no!★ less code more magic★ not so flexible (specification is growing)★ using SQLAlchemy within could be tricky
  • 63. d r u pal: no!★ security problems (370 CVE entries)★ integration is more difficult (PHP vs. Python)★ missing features workflow, complex ACL, etc.
  • 64. o pen erp : no!★ quite complex: CRM , sales, accounting and much more★ not enough time to fully investigate it★ not a generic framework
  • 65. results
  • 66. What mat t ers?
  • 67. Proper Tools
  • 68. and a g o o d t eam
  • 69. ★ Prototyping - it’s always a lot of fun, but... ★ be aware of The Learning Curve Effect★ Collecting specification and keeping docs up-to-date (a real on-going process)
  • 70. check this out!
  • 71. pyramid_formalchemy★ started by gawel (Gaël Pasgrimaud) and supported by★ using SQLAlchemy, Formalchemy and fanstatic★ available on pypi more then 1720 downloads so far
  • 72. pyramid_formalchemy★ Lots of improvements during by ★ events hooks ★ view and action customizations ★ i18n support ★ paster templates ★ fanstatic integration
  • 73. pyramid_formalchemy★ Minimal configuration:
  • 74. pyramid_formalchemy★ Minimal configuration:def main(global_config, **settings): engine = engine_from_config(settings, sqlalchemy.) initialize_sql(engine) config = Configurator(settings=settings) # pyramid_formalchemys configuration config.include(pyramid_formalchemy) # register an admin UI config.formalchemy_admin(/admin, package=pyramidapp) return config.make_wsgi_app()
  • 75. pyramid_formalchemy★ Events subscriptions:
  • 76. pyramid_formalchemy★ Events subscriptions:@events.subscriber([User, events.IBeforeEditRenderEvent])def before_user_edit(context, event): fs = event.kwargs[fs] # add roles_manage field for manager: if not has_permission(manage, event.request): fs.append(fs.roles_manage) # set TinyMCE as a renderer for biography field: fs.biography.set(renderer=tinymce)
  • 77. pyramid_formalchemy★ demo http://docs.formalchemy.org/demo/admin★ documentation http://docs.formalchemy.org/pyramid_formalchemy★ download http://pypi.python.org/pypi/pyramid_formalchemy
  • 78. pyramid_formalchemy★ demo http://docs.formalchemy.org/demo/admin★ documentation http://docs.formalchemy.org/pyramid_formalchemy★ download http://pypi.python.org/pypi/pyramid_formalchemy
  • 79. fa.bootstrap ★ a pyramid_formalchemy plugin ★ based on twitter bootstrap ★ integrated with fanstatic ★ released on pypi http://pypi.python.org/pypi/fa.bootstrap
  • 80. fa.bootstrap
  • 81. fa.bootstrap
  • 82. fa.bootstrap
  • 83. fa.bootstrap
  • 84. fa.bootstrap
  • 85. fa.bootstrap
  • 86. fa.bootstrap
  • 87. Qu est i ons?
  • 88. Credits★ http://flickr.com/photos/mleczko★ http://www.melaiphone.com/★ http://static.iphoneitalia.com★ http://www.theapplelounge.com★ http://www.nonconvenzionale.com★ http://craziestgadgets.com/★ http://obsessivelystitching.blogspot.com/★ http://theclockblog.blogspot.com/★ http://www.scatoladeigiochi.altervista.org/★ http://wallpapers.brothersoft.com/★ www.prisionerodelpixel.com★ http://jawaexpress.com/★ http://mikehenneke.mvourtown.com/★ http://android-apps.com/