SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
Django admin
       Petter Arvidsson
Software architect at Fyndiq AB
What is the Django admin
                   application?
●   It's a
    ●   framework for rapidly developing administrative
        backends
    ●   well integrated part of Django
●   It's not a
    ●   lightweight DBMS
        –    Doesn't compare to e.g. phpMyAdmin
    ●   CMS
        –    There exists applications that extends Django and admin
             to be a CMS
Admin in relation to Django
Model               Declarative   Change list
                    Inferred



                 ModelAdmin




ModelForm                         Change/add view
Models
           Model                            Change
                                            list
                                                            ●   Everyone knows
                           Model
                                                                about Models, right?
                           Admin

           Model                            Change
                                                            ●   Declarative definitions
           Form                             /add
                                            view                of data bundles
                                                            ●   Provides validation
●   Tip
    ●   Model fields contains several options that are
        directly linked to their behaviour in ModelForms
                                                            ●   Provides data
    ●
        (and therefore indirectly in admin):
        Blank, choices, editable, help_text, verbose_name
                                                                consistency
ModelForms
          Model                           Change
                                                          ●   Fields are declared from the
                                          list
                                                              Fields present in the Model
                          Model
                          Admin                           ●   Provides validation
          Model
          Form
                                          Change
                                          /add
                                                              ●   Including user friendly error
                                          view
                                                                  messages
                                                          ●   Renders as HTML
●   Tip                                                       ●   Including error messages
    ●   Forms keeps tracks of which fields that have
        changed. A model form that is given an instance
        will automatically populate the changed_data
                                                          ●   Easily customizable
        property with any fields that were changed
                                                          ●   Can create or update a
                                                              bound model instance
Admin in relation to Django
Model               Declarative   Change list
                    Inferred



                 ModelAdmin




ModelForm                         Change/add view
ModelAdmin
          Model                    Change
                                                ●   Defines the change list and
                                   list
                                                    the change/add view
                      Model
                      Admin                     ●   Customizable
          Model                    Change           ●   Change list
          Form                     /add
                                   view                 –   Columns
                                                        –   Sorting
                                                        –   Search
●   Tip                                                 –   Filtering
    ●   ModelAdmins can inherit in the same             –   …
        way as Models can inherit. A powerful
        pattern is to complement abstract
                                                    ●   Change/add view
        models with ModelAdmin classes                  –   Fields
                                                        –   Inline
                                                        –   Create your own ModelForm
                                                        –   …
Admin actions
        Model                 Change
                                            ●   Bulk actions on steroids
                              list
                                                ●   Filter, search, select and then
                   Model
                   Admin
                                                    execute
        Model                 Change
                                            ●   Define your own actions
        Form                  /add
                              view              ●   Actions are methods on the
                                                    ModelAdmin
                                                ●   Global actions (generic for all
●   Tip                                             models)
    ●   Use admin actions to filter other       ●   Local actions (specialized for
        admin views                                 one model)
    ●   E.g. select an author and
        create an action to show all
        books written by her/him
Result
          Model                              Change
                                             list
                                                              ●   Well defined, user
                            Model
                                                                  friendly administrative
                            Admin
                                                                  interfaces
          Model                              Change
          Form                               /add
                                             view             ●   Extremely short
                                                                  development times
●   Tip
    ●   The fact that Django is highly modular does not
        by itself imply that it's a good idea to start only
        using a limited amount of modules. E.g. if you
        build your application only using Models it might
        be really hard to add Forms and Admin later on
Where to go next?
●   Django documentation
●   James Bennet, Django in Depth at PyCon US
    2012 (available from youtube.com)
●   Django/contrib/admin/
●   Join us?

Contenu connexe

Similaire à Django admin

No magic@md day2011
No magic@md day2011No magic@md day2011
No magic@md day2011MDDAY11
 
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...Chauvin Mariot
 
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...EclipseDayParis
 
Joomla Extensions Kung Fu
Joomla Extensions Kung FuJoomla Extensions Kung Fu
Joomla Extensions Kung FuOleg Nesterov
 
2 trasnformation design_patterns-sandeep_katoch
2 trasnformation design_patterns-sandeep_katoch2 trasnformation design_patterns-sandeep_katoch
2 trasnformation design_patterns-sandeep_katochIBM
 
Trasnformation Design Patterns - Sandeep Katoch
Trasnformation Design Patterns - Sandeep KatochTrasnformation Design Patterns - Sandeep Katoch
Trasnformation Design Patterns - Sandeep KatochRoopa Nadkarni
 
2007 Services Records Updating Procedure
2007 Services Records Updating Procedure2007 Services Records Updating Procedure
2007 Services Records Updating Procedureglynnwilliamsarchitects
 
What's New in newforms-admin
What's New in newforms-adminWhat's New in newforms-admin
What's New in newforms-adminbrosner
 
Features module in drupal 8
Features module in drupal 8Features module in drupal 8
Features module in drupal 8valuebound
 
HANA SPS07 Modeling Enhancements
HANA SPS07 Modeling EnhancementsHANA SPS07 Modeling Enhancements
HANA SPS07 Modeling EnhancementsSAP Technology
 
An introduction to the MDA
An introduction to the MDAAn introduction to the MDA
An introduction to the MDALai Ha
 
Benefits of using software design patterns and when to use design pattern
Benefits of using software design patterns and when to use design patternBenefits of using software design patterns and when to use design pattern
Benefits of using software design patterns and when to use design patternBeroza Paul
 
Tech talk live content type and form design tools
Tech talk live content type and form design toolsTech talk live content type and form design tools
Tech talk live content type and form design toolsAlfresco Software
 

Similaire à Django admin (19)

No magic@md day2011
No magic@md day2011No magic@md day2011
No magic@md day2011
 
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
Mixing Diagram, Tree, Text, Table and Form editors to build a kick-ass modeli...
 
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
Solution de génération de rapport OpenDocument à partir de plusieurs sources ...
 
Joomla Extensions Kung Fu
Joomla Extensions Kung FuJoomla Extensions Kung Fu
Joomla Extensions Kung Fu
 
Ozone presentation
Ozone presentationOzone presentation
Ozone presentation
 
2 trasnformation design_patterns-sandeep_katoch
2 trasnformation design_patterns-sandeep_katoch2 trasnformation design_patterns-sandeep_katoch
2 trasnformation design_patterns-sandeep_katoch
 
Trasnformation Design Patterns - Sandeep Katoch
Trasnformation Design Patterns - Sandeep KatochTrasnformation Design Patterns - Sandeep Katoch
Trasnformation Design Patterns - Sandeep Katoch
 
197 ssp seminar05_murphy
197 ssp seminar05_murphy197 ssp seminar05_murphy
197 ssp seminar05_murphy
 
2007 Services Records Updating Procedure
2007 Services Records Updating Procedure2007 Services Records Updating Procedure
2007 Services Records Updating Procedure
 
What's New in newforms-admin
What's New in newforms-adminWhat's New in newforms-admin
What's New in newforms-admin
 
Features module in drupal 8
Features module in drupal 8Features module in drupal 8
Features module in drupal 8
 
Workflow for XPages
Workflow for XPagesWorkflow for XPages
Workflow for XPages
 
HANA SPS07 Modeling Enhancements
HANA SPS07 Modeling EnhancementsHANA SPS07 Modeling Enhancements
HANA SPS07 Modeling Enhancements
 
An introduction to the MDA
An introduction to the MDAAn introduction to the MDA
An introduction to the MDA
 
The MVVM Pattern
The MVVM PatternThe MVVM Pattern
The MVVM Pattern
 
Benefits of using software design patterns and when to use design pattern
Benefits of using software design patterns and when to use design patternBenefits of using software design patterns and when to use design pattern
Benefits of using software design patterns and when to use design pattern
 
Design Patterns (Examples in .NET)
Design Patterns (Examples in .NET)Design Patterns (Examples in .NET)
Design Patterns (Examples in .NET)
 
Tech talk live content type and form design tools
Tech talk live content type and form design toolsTech talk live content type and form design tools
Tech talk live content type and form design tools
 
Talk at ICTM '12
Talk at ICTM '12Talk at ICTM '12
Talk at ICTM '12
 

Dernier

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Dernier (20)

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Django admin

  • 1. Django admin Petter Arvidsson Software architect at Fyndiq AB
  • 2. What is the Django admin application? ● It's a ● framework for rapidly developing administrative backends ● well integrated part of Django ● It's not a ● lightweight DBMS – Doesn't compare to e.g. phpMyAdmin ● CMS – There exists applications that extends Django and admin to be a CMS
  • 3. Admin in relation to Django Model Declarative Change list Inferred ModelAdmin ModelForm Change/add view
  • 4. Models Model Change list ● Everyone knows Model about Models, right? Admin Model Change ● Declarative definitions Form /add view of data bundles ● Provides validation ● Tip ● Model fields contains several options that are directly linked to their behaviour in ModelForms ● Provides data ● (and therefore indirectly in admin): Blank, choices, editable, help_text, verbose_name consistency
  • 5. ModelForms Model Change ● Fields are declared from the list Fields present in the Model Model Admin ● Provides validation Model Form Change /add ● Including user friendly error view messages ● Renders as HTML ● Tip ● Including error messages ● Forms keeps tracks of which fields that have changed. A model form that is given an instance will automatically populate the changed_data ● Easily customizable property with any fields that were changed ● Can create or update a bound model instance
  • 6. Admin in relation to Django Model Declarative Change list Inferred ModelAdmin ModelForm Change/add view
  • 7. ModelAdmin Model Change ● Defines the change list and list the change/add view Model Admin ● Customizable Model Change ● Change list Form /add view – Columns – Sorting – Search ● Tip – Filtering ● ModelAdmins can inherit in the same – … way as Models can inherit. A powerful pattern is to complement abstract ● Change/add view models with ModelAdmin classes – Fields – Inline – Create your own ModelForm – …
  • 8. Admin actions Model Change ● Bulk actions on steroids list ● Filter, search, select and then Model Admin execute Model Change ● Define your own actions Form /add view ● Actions are methods on the ModelAdmin ● Global actions (generic for all ● Tip models) ● Use admin actions to filter other ● Local actions (specialized for admin views one model) ● E.g. select an author and create an action to show all books written by her/him
  • 9. Result Model Change list ● Well defined, user Model friendly administrative Admin interfaces Model Change Form /add view ● Extremely short development times ● Tip ● The fact that Django is highly modular does not by itself imply that it's a good idea to start only using a limited amount of modules. E.g. if you build your application only using Models it might be really hard to add Forms and Admin later on
  • 10. Where to go next? ● Django documentation ● James Bennet, Django in Depth at PyCon US 2012 (available from youtube.com) ● Django/contrib/admin/ ● Join us?