SlideShare a Scribd company logo
1 of 109
Download to read offline
How to build complex
web applications having   fun?
How to build complex
web applications having   fun?
author
         Andrew Mleczko
         Software Integrator
         Ferrara (Italy)
            amleczko
            amleczko@redturtle.it
author
         Andrew Mleczko
         Software Integrator
         Ferrara (Italy)
            amleczko
            amleczko@redturtle.it
author
         Ferrara   Andrew Mleczko
                   Software Integrator
                   Ferrara (Italy)
                      amleczko
                      amleczko@redturtle.it
the   team
the   team
WHY this talk?
My Reasons to be here
★ Building   complex web
  applications should

  be   fun

★ to promote
SMALL   “Roughly 5000 lines
             of code”
SMALL   “Roughly 5000 lines
             of code”
FAST
SMALL    “Roughly 5000 lines
              of code”
FAST
STABLE
SMALL    “Roughly 5000 lines
              of code”
FAST
                “100% statement
STABLE
               coverage via unit and
TESTED           integration tests”
SMALL        “Roughly 5000 lines
                  of code”
FAST
                    “100% statement
STABLE
                   coverage via unit and
TESTED               integration tests”


DOCUMENTED    “Literally nothing
                  in Pyramid
              is undocumented”
★   Debug Toolbar

★   Flexible authentication
    and authorization

★   Tweens - a bit like WSGI
    middleware
★   Decorator-based configuration


from pyramid.view import view_config
from pyramid.response import Response

@view_config(route_name='fred')
def fred_view(request):
    return Response('fred')
★   Event system (based on ZCA)

from pyramid.events import NewRequest
from pyramid.events import subscriber

@subscriber(NewRequest)
def mysubscriber(event):
    event.request.foo = 1
★ Extendable configuration

from pyramid.config import Configurator

if __name__ == '__main__':
   config = Configurator()
   config.include('pyramid_formalchemy')
the project
The Customer
★ .


★ Born as a startup


★ Offices in US
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”
project requirements
paperless sale
paperless sale
          Sales           E-commerce




1            2    3           4          5




    CRM           Warehouse            Support
paperless sale
1      CRM



2     Sales




3   Warehouse



4   E-commerce




5    Support
paperless sale
1      CRM



2     Sales



3   Warehouse



4   E-commerce



5    Support
paperless sale
1      CRM       ★   Customer’s management
                     (satisfaction, order status,
                     etc.)
2     Sales
                 ★   Reports (machine statistics,
                     etc.)
3   Warehouse
                 ★   Campaigns

4   E-commerce



5    Support
paperless sale
1      CRM       ★   Sales network management


                 ★   Invoicing / accountancy
2     Sales
                 ★   Revenue counter

3   Warehouse    ★   Discount management


4   E-commerce



5    Support
paperless sale
1      CRM       ★   Catalog management


                 ★   Warehouse management
2     Sales
                 ★   Logistic tracking

3   Warehouse



4   E-commerce



5    Support
paperless sale
1      CRM       ★   Online shop (for beverages
                     and accessories)


2     Sales      ★   Machine configurator
                     (interactive wizard)

3   Warehouse    ★   Online payments



4   E-commerce



5    Support
paperless sale
1      CRM       ★   Machine maintenance (filter
                     change)


2     Sales      ★   Emergency services


                 ★   Order / installation process
3   Warehouse



4   E-commerce



5    Support
paperless sale
1      CRM       ★   Machine maintenance (filter
                     change)


2     Sales      ★   Emergency services


                 ★   Order / installation process
3   Warehouse



4   E-commerce



5    Support
paperless sale


    Warehouse     Support



      CRM        E-commerce




      Sales
paperless sale
   Intranet      Extranet

    Warehouse     Support



      CRM        E-commerce




      Sales
Totally paperless ERP
project gotchas
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
Arc hi t e ct u ral dec i si ons
and
and
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
why                         ?
★ pyramid_formalchemy CRUD

★ easy pluggable widgets

  ★ Multi-upload

  ★ Metric units

  ★ Autocomplete

  ★ Multi-relation

★ 75% jQuery code
why                         ?
★ pyramid_formalchemy CRUD

★ easy pluggable widgets

  ★ Multi-upload

  ★ Metric units

  ★ Autocomplete

  ★ Multi-relation

★ 75% jQuery code
why                         ?
★ pyramid_formalchemy CRUD

★ easy pluggable widgets

  ★ Multi-upload

  ★ Metric units

  ★ Autocomplete

  ★ Multi-relation

★ 75% jQuery code
and                         ?
★ The Best CMS ever


★ easy to integrate with
  other Python frameworks


★ almost 2000 addons
and                          ?
★ The Best CMS ever


★ easy to integrate with
  other Python frameworks


★ almost 2000 addons


   ★   Diazo (plone.app.theming)

   ★   Poi

   ★   PAS (PluggableAuthService)
and                          ?
★ The Best CMS ever


★ easy to integrate with
  other Python frameworks


★ almost 2000 addons


   ★   Diazo (plone.app.theming)

   ★   Poi

   ★   PAS (PluggableAuthService)
and                          ?
★ The Best CMS ever


★ easy to integrate with
  other Python frameworks


★ almost 2000 addons


   ★   Diazo (plone.app.theming)

   ★   Poi

   ★   PAS (PluggableAuthService)
and                          ?
★ The Best CMS ever


★ easy to integrate with
  other Python frameworks


★ almost 2000 addons


   ★   Diazo (plone.app.theming)

   ★   Poi

   ★   PAS (PluggableAuthService)
and                          ?
★ The Best CMS ever


★ easy to integrate with
  other Python frameworks


★ almost 2000 addons


   ★   Diazo (plone.app.theming)

   ★   Poi

   ★   PAS (PluggableAuthService)
I nt eg r at i o n
SQL A lchemy
SQL A lchemy

         aeterna.models




         PostgreSQL
authentication - authorization
authentication - authorization
           auth storage
 Request




            pas.plugins.sa




             repoze.who




            PostgreSQL
authentication - authorization
      auth storage
 ★   users

 ★   groups

 ★   roles



       PostgreSQL
authentication - authorization
      auth storage        single-sign-on
 ★   users           ★   plone.session

                     ★   repoze.who.plugins.auth_tkt
 ★   groups

 ★   roles
                            mod_auth_tkt



       PostgreSQL
buildout
[intranet-plone]
recipe = plone.recipe.zope2instance
eggs =
    ${intranet-plone:eggs} aeterna.models


[intranet-pyramid]
recipe = zc.recipe.egg
eggs =
    ${intranet-pyramid:eggs} aeterna.models
The big picture
                  pas.plugins.
                       sa

                                          ZODB
Apache




         beaker              PostgreSQL

                   repoze.
                     who
The big picture




                                                 extranet
                  pas.plugins.
                       sa

                                          ZODB
Apache




         beaker              PostgreSQL




                                                 intranet
                   repoze.
                     who
why not o t h er c o mpet i t o rs?
d j ang o :           no!
★ less   code more magic

★ not so   flexible
  (specification is growing)


★ using   SQLAlchemy within
  could be tricky
d r u pal:              no!
★   security problems
    (370 CVE entries)


★   integration is more difficult
    (PHP vs. Python)


★   missing features
    workflow, complex ACL, etc.
o pen erp :                 no!
★ quite complex: CRM , sales,
  accounting and much more


★ not enough   time
  to fully investigate it


★ not a generic framework
results
What mat t ers?
Proper Tools
and a g o o d t eam
★ 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)
check this out!
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
pyramid_formalchemy
★   Lots of improvements during


                           by

    ★   events hooks

    ★   view and action customizations

    ★   i18n support

    ★   paster templates

    ★   fanstatic integration
pyramid_formalchemy
★   Minimal configuration:
pyramid_formalchemy
★   Minimal configuration:

def main(global_config, **settings):

      engine = engine_from_config(settings, 'sqlalchemy.')
      initialize_sql(engine)
      config = Configurator(settings=settings)

      # pyramid_formalchemy's configuration
      config.include('pyramid_formalchemy')

      # register an admin UI
      config.formalchemy_admin('/admin', package='pyramidapp')

      return config.make_wsgi_app()
pyramid_formalchemy
★   Events subscriptions:
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)
pyramid_formalchemy

★   demo
    http://docs.formalchemy.org/demo/admin


★   documentation
    http://docs.formalchemy.org/pyramid_formalchemy


★   download
    http://pypi.python.org/pypi/pyramid_formalchemy
pyramid_formalchemy

★   demo
    http://docs.formalchemy.org/demo/admin


★   documentation
    http://docs.formalchemy.org/pyramid_formalchemy


★   download
    http://pypi.python.org/pypi/pyramid_formalchemy
fa.bootstrap

               ★ a   pyramid_formalchemy plugin

               ★ based on   twitter bootstrap

               ★ integrated with   fanstatic

               ★ released on pypi

                  http://pypi.python.org/pypi/fa.bootstrap
fa.bootstrap
fa.bootstrap
fa.bootstrap
fa.bootstrap
fa.bootstrap
fa.bootstrap
fa.bootstrap
Qu est i ons?
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/

More Related Content

More from Andrew Mleczko

Bootstrap your app in 45 seconds
Bootstrap your app in 45 secondsBootstrap your app in 45 seconds
Bootstrap your app in 45 secondsAndrew Mleczko
 
PyconUA - How to build ERP application having fun?
PyconUA - How to build ERP application having fun?PyconUA - How to build ERP application having fun?
PyconUA - How to build ERP application having fun?Andrew Mleczko
 
EuroPython 2011 - How to build complex web applications having fun?
EuroPython 2011 - How to build complex web applications having fun?EuroPython 2011 - How to build complex web applications having fun?
EuroPython 2011 - How to build complex web applications having fun?Andrew Mleczko
 
Future is bright, future is Plone
Future is bright, future is PloneFuture is bright, future is Plone
Future is bright, future is PloneAndrew Mleczko
 
Needle in an enterprise haystack
Needle in an enterprise haystackNeedle in an enterprise haystack
Needle in an enterprise haystackAndrew Mleczko
 
Fast content import in Plone
Fast content import in PloneFast content import in Plone
Fast content import in PloneAndrew Mleczko
 
Plone TuneUp challenges
Plone TuneUp challengesPlone TuneUp challenges
Plone TuneUp challengesAndrew Mleczko
 

More from Andrew Mleczko (7)

Bootstrap your app in 45 seconds
Bootstrap your app in 45 secondsBootstrap your app in 45 seconds
Bootstrap your app in 45 seconds
 
PyconUA - How to build ERP application having fun?
PyconUA - How to build ERP application having fun?PyconUA - How to build ERP application having fun?
PyconUA - How to build ERP application having fun?
 
EuroPython 2011 - How to build complex web applications having fun?
EuroPython 2011 - How to build complex web applications having fun?EuroPython 2011 - How to build complex web applications having fun?
EuroPython 2011 - How to build complex web applications having fun?
 
Future is bright, future is Plone
Future is bright, future is PloneFuture is bright, future is Plone
Future is bright, future is Plone
 
Needle in an enterprise haystack
Needle in an enterprise haystackNeedle in an enterprise haystack
Needle in an enterprise haystack
 
Fast content import in Plone
Fast content import in PloneFast content import in Plone
Fast content import in Plone
 
Plone TuneUp challenges
Plone TuneUp challengesPlone TuneUp challenges
Plone TuneUp challenges
 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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...Martijn de Jong
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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...apidays
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 RobisonAnna Loughnan Colquhoun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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 2024The Digital Insurer
 
[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.pdfhans926745
 
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 productivityPrincipled Technologies
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
[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
 
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
 

PloneConf2011 - How to build ERP application while having fun

  • 1. How to build complex web applications having fun?
  • 2. How to build complex web 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
  • 9. My Reasons to be here ★ Building complex web applications should be fun ★ to promote
  • 10.
  • 11.
  • 12. SMALL “Roughly 5000 lines of code”
  • 13. SMALL “Roughly 5000 lines of code” FAST
  • 14. SMALL “Roughly 5000 lines of code” FAST STABLE
  • 15. SMALL “Roughly 5000 lines of code” FAST “100% statement STABLE coverage via unit and TESTED integration tests”
  • 16. SMALL “Roughly 5000 lines of code” FAST “100% statement STABLE coverage via unit and TESTED integration tests” DOCUMENTED “Literally nothing in Pyramid is undocumented”
  • 17. Debug Toolbar ★ Flexible authentication and authorization ★ Tweens - a bit like WSGI middleware
  • 18. Decorator-based configuration from pyramid.view import view_config from pyramid.response import Response @view_config(route_name='fred') def fred_view(request): return Response('fred')
  • 19. Event system (based on ZCA) from pyramid.events import NewRequest from pyramid.events import subscriber @subscriber(NewRequest) def mysubscriber(event): event.request.foo = 1
  • 20. ★ Extendable configuration from pyramid.config import Configurator if __name__ == '__main__': config = Configurator() config.include('pyramid_formalchemy')
  • 22. The Customer ★ . ★ Born as a startup ★ Offices in US
  • 23. 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”
  • 24.
  • 25.
  • 27.
  • 29. paperless sale Sales E-commerce 1 2 3 4 5 CRM Warehouse Support
  • 30. paperless sale 1 CRM 2 Sales 3 Warehouse 4 E-commerce 5 Support
  • 31. paperless sale 1 CRM 2 Sales 3 Warehouse 4 E-commerce 5 Support
  • 32. paperless sale 1 CRM ★ Customer’s management (satisfaction, order status, etc.) 2 Sales ★ Reports (machine statistics, etc.) 3 Warehouse ★ Campaigns 4 E-commerce 5 Support
  • 33. paperless sale 1 CRM ★ Sales network management ★ Invoicing / accountancy 2 Sales ★ Revenue counter 3 Warehouse ★ Discount management 4 E-commerce 5 Support
  • 34. paperless sale 1 CRM ★ Catalog management ★ Warehouse management 2 Sales ★ Logistic tracking 3 Warehouse 4 E-commerce 5 Support
  • 35. paperless sale 1 CRM ★ Online shop (for beverages and accessories) 2 Sales ★ Machine configurator (interactive wizard) 3 Warehouse ★ Online payments 4 E-commerce 5 Support
  • 36. paperless sale 1 CRM ★ Machine maintenance (filter change) 2 Sales ★ Emergency services ★ Order / installation process 3 Warehouse 4 E-commerce 5 Support
  • 37. paperless sale 1 CRM ★ Machine maintenance (filter change) 2 Sales ★ Emergency services ★ Order / installation process 3 Warehouse 4 E-commerce 5 Support
  • 38. paperless sale Warehouse Support CRM E-commerce Sales
  • 39. paperless sale Intranet Extranet Warehouse Support CRM E-commerce Sales
  • 42. 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
  • 43. Arc hi t e ct u ral dec i si ons
  • 44. and
  • 45. and
  • 46.
  • 47. 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
  • 48. why ? ★ pyramid_formalchemy CRUD ★ easy pluggable widgets ★ Multi-upload ★ Metric units ★ Autocomplete ★ Multi-relation ★ 75% jQuery code
  • 49. why ? ★ pyramid_formalchemy CRUD ★ easy pluggable widgets ★ Multi-upload ★ Metric units ★ Autocomplete ★ Multi-relation ★ 75% jQuery code
  • 50. why ? ★ pyramid_formalchemy CRUD ★ easy pluggable widgets ★ Multi-upload ★ Metric units ★ Autocomplete ★ Multi-relation ★ 75% jQuery code
  • 51. and ? ★ The Best CMS ever ★ easy to integrate with other Python frameworks ★ almost 2000 addons
  • 52. and ? ★ The Best CMS ever ★ easy to integrate with other Python frameworks ★ almost 2000 addons ★ Diazo (plone.app.theming) ★ Poi ★ PAS (PluggableAuthService)
  • 53. and ? ★ The Best CMS ever ★ easy to integrate with other Python frameworks ★ almost 2000 addons ★ Diazo (plone.app.theming) ★ Poi ★ PAS (PluggableAuthService)
  • 54. and ? ★ The Best CMS ever ★ easy to integrate with other Python frameworks ★ almost 2000 addons ★ Diazo (plone.app.theming) ★ Poi ★ PAS (PluggableAuthService)
  • 55. and ? ★ The Best CMS ever ★ easy to integrate with other Python frameworks ★ almost 2000 addons ★ Diazo (plone.app.theming) ★ Poi ★ PAS (PluggableAuthService)
  • 56. and ? ★ The Best CMS ever ★ easy to integrate with other Python frameworks ★ almost 2000 addons ★ Diazo (plone.app.theming) ★ Poi ★ PAS (PluggableAuthService)
  • 57. I nt eg r at i o n
  • 59. SQL A lchemy aeterna.models PostgreSQL
  • 61. authentication - authorization auth storage Request pas.plugins.sa repoze.who PostgreSQL
  • 62. authentication - authorization auth storage ★ users ★ groups ★ roles PostgreSQL
  • 63. authentication - authorization auth storage single-sign-on ★ users ★ plone.session ★ repoze.who.plugins.auth_tkt ★ groups ★ roles mod_auth_tkt PostgreSQL
  • 64. buildout [intranet-plone] recipe = plone.recipe.zope2instance eggs = ${intranet-plone:eggs} aeterna.models [intranet-pyramid] recipe = zc.recipe.egg eggs = ${intranet-pyramid:eggs} aeterna.models
  • 65. The big picture pas.plugins. sa ZODB Apache beaker PostgreSQL repoze. who
  • 66. The big picture extranet pas.plugins. sa ZODB Apache beaker PostgreSQL intranet repoze. who
  • 67. why not o t h er c o mpet i t o rs?
  • 68. d j ang o : no! ★ less code more magic ★ not so flexible (specification is growing) ★ using SQLAlchemy within could be tricky
  • 69. d r u pal: no! ★ security problems (370 CVE entries) ★ integration is more difficult (PHP vs. Python) ★ missing features workflow, complex ACL, etc.
  • 70. o pen erp : no! ★ quite complex: CRM , sales, accounting and much more ★ not enough time to fully investigate it ★ not a generic framework
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87. What mat t ers?
  • 89. and a g o o d t eam
  • 90. ★ 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)
  • 92. 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
  • 93. pyramid_formalchemy ★ Lots of improvements during by ★ events hooks ★ view and action customizations ★ i18n support ★ paster templates ★ fanstatic integration
  • 94. pyramid_formalchemy ★ Minimal configuration:
  • 95. pyramid_formalchemy ★ Minimal configuration: def main(global_config, **settings): engine = engine_from_config(settings, 'sqlalchemy.') initialize_sql(engine) config = Configurator(settings=settings) # pyramid_formalchemy's configuration config.include('pyramid_formalchemy') # register an admin UI config.formalchemy_admin('/admin', package='pyramidapp') return config.make_wsgi_app()
  • 96. pyramid_formalchemy ★ Events subscriptions:
  • 97. 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)
  • 98. pyramid_formalchemy ★ demo http://docs.formalchemy.org/demo/admin ★ documentation http://docs.formalchemy.org/pyramid_formalchemy ★ download http://pypi.python.org/pypi/pyramid_formalchemy
  • 99. pyramid_formalchemy ★ demo http://docs.formalchemy.org/demo/admin ★ documentation http://docs.formalchemy.org/pyramid_formalchemy ★ download http://pypi.python.org/pypi/pyramid_formalchemy
  • 100. fa.bootstrap ★ a pyramid_formalchemy plugin ★ based on twitter bootstrap ★ integrated with fanstatic ★ released on pypi http://pypi.python.org/pypi/fa.bootstrap
  • 108. Qu est i ons?
  • 109. 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/