SlideShare una empresa de Scribd logo
1 de 28
Dynamic Models
in Django
Juergen Schackmann
j.schackmann@reliatec.de
© Juergen Schackmann 2013 2/28
Me
▸ Python & Django since 4 years
▸ reliatec.de since 3 months
▸ Django Web Applications
▸ Focus: EDC systems for clinical studies & Telemonitoring
© Juergen Schackmann 2013 3/28
Objective
▸ Why do do we care about Django Dynamic Models?
▸ Why do we have to talk about them?
▸ What should we do about them?
Static vs Dynamic Models
© Juergen Schackmann 2013 5/28
Models in a Django project
Phase1:
Code Development
Models and model
attributes are defined by
implementing those with
Python code
Phase 2:
Deployment
Underlying database tables
and columns are created by
running “syncdb” command
Phase 3:
Runtime
Models / DB Tables are
populated with content as
part of the user
interactions
© Juergen Schackmann 2013 6/28
Problem?
There is no way to adapt the Django Models at runtime based on
user interactions
▸ Django Models are defined and implemented during
development phase
▸ Django Models are expected to be static after deployment
▸ Django DB Backends only fully support SQL databases, i.e. a
schema is required
▸ DB specific solutions limit adoption rate of any reusable App
Use Cases for Dynamic
Models
© Juergen Schackmann 2013 8/28
Custom Content Types for a CMS*
* system: dotCms (Java); source: http://dotcms.com/
© Juergen Schackmann 2013 9/28
Customized Products for an Ecommerce Shop*
* system: Magento (PHP); source: averybrandandprint.co.uk
© Juergen Schackmann 2013 10/28
Clinical Research Forms*
* system: OpenClinica (Java); source: openclinica.com
© Juergen Schackmann 2013 11/28
Problem? Which Problem?
▸ Models / Content Types are domain or site specific
▸ Neither realistic nor efficient to implement all thinkable content
types into a software product
▸ Configuration by subject-matter experts is better, than code
customization by developers
▸ Dynamic Models reduce the number of deployment cycles
Evaluation of
Patterns & Apps
© Juergen Schackmann 2013 13/28
As a User, I ...
▸ want to maintain my dynamic models easily without
understanding any Django Model details
▸ want extend existing (static) models without thinking about
static and dynamic parts
▸ do not want to think about performance, when creating my
custom fields
▸ I want to be able to query/search for certain information
seamlessly over static and dynamic models
© Juergen Schackmann 2013 14/28
As a developer, I ...
▸ want my dynamic models to be integrated with Django Standard
Tools (admin, migrations, reversion) out of the box
▸ want to apply the same API that I use for the static models
▸ do not want to use or be limited to specific databases, but use
the standard Django backends
▸ want to have a customizable front-end for my users to manage
the dynamic models
© Juergen Schackmann 2013 15/28
Evaluation Criteria
▸ Performance
▸ “Querybility”
▸ Django Standard Tools Integration (Admin, Cache, ...)
▸ Supported Backend
▸ Complexity/ Maintainability
© Juergen Schackmann 2013 16/28
Entity Attribute Value (EAV)
Transform your table columns into table rows
Attribute 1 Attribute 2 Attribute n
Table
Attribute
Name
Attribute
Value
Attribute
TableTable has1 n
© Juergen Schackmann 2013 17/28
EAV Django Apps
▸ bitbucket.org/neithere/eav-django/
▸ github.com/mvpdev/django-eav
© Juergen Schackmann 2013 18/28
Serialized Dictionary
Transform your table columns into pickeld or jsoned dictionaries
Attribute 1 Attribute 2 Attribute n
Table
Dictionary
String
Attributes
{“attribute1”:”a”, “attribute2”: 5, “attribute3”:[1,2] }
© Juergen Schackmann 2013 19/28
Serialized Dictionary Django Apps
Fields
▸ bitbucket.org/schinckel/django-jsonfield/
▸ github.com/bradjasper/django-jsonfield
▸ github.com/derek-schaefer/django-json-field
▸ github.com/shrubberysoft/django-picklefield
App
▸ github.com/dobarkod/django-dynamic-model
© Juergen Schackmann 2013 20/28
Runtime Schema Updates
Update Django models and database schema at runtime using
▸ syncdb functionality
▸ South functionality
▸ eventually: Andrew Godwin's “Schema Migrations for Django”
© Juergen Schackmann 2013 21/28
Runtime Schema Update Django Apps
Update Django models and database schema at runtime using
▸ Syncdb
▸ bitbucket.org/mhall119/dynamo/overview
▸ South
▸ github.com/willhardy/dynamic-models
▸ github.com/willhardy/django-dymo
▸ bitbucket.org/schacki/django-dynamo
▸ github.com/charettes/django-mutant
▸ Schema Migrations
▸ github.com/charettes/django-mutant
© Juergen Schackmann 2013 22/28
Database specific solutions
Hstore
▸ github.com/jordanm/django-hstore
▸ postgresql.org/docs/9.0/static/hstore.html
No SQL
▸ github.com/django-nonrel
▸ github.com/pydanny/django-mongonaut
© Juergen Schackmann 2013 23/28
Summary
EAV Serialization Schema Updates
Performance   
Querybility   
Django Standard
Tools
 / 
Supported
Backend
  
Complexity/
Maintainability
  
© Juergen Schackmann 2013 24/28
Schema Update most powerful, but ...
▸ Name clashes between developer models and dynamic models
(especially with schema migrations)
▸ Multiple Users updating the same model (possibly even
conflicting)
▸ Orphan database elements
▸ Dynamic Model loading at startup
▸ How to find/inject dynamic models into views and templates
Components of a
Dynamic Model App
© Juergen Schackmann 2013 26/28
Must have components of a Dynamic Model
Application
▸ Meta Model Front End to let users maintain their meta models
▸ Meta Model Representation to store the meta model information
▸ Meta Model Analyzer to detect changes that require some further
actions (for schema, admin or model)
▸ Schema Sync Manager to update and sync the database schema
▸ Admin Sync Manager to update and sync the Django admin
▸ Model/Cache Sync Manager to update and sync the Django models
and model cache
© Juergen Schackmann 2013 27/28
More resources on dynamic models
▸ code.djangoproject.com/wiki/DynamicModels
▸ djangopackages.com/grids/g/forms/
▸ stackoverflow.com/questions/7933596/django-dynamic-model-
fields/7934577
Thank you very much!
Questions please?

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

On page off-page seo points
On page off-page seo pointsOn page off-page seo points
On page off-page seo points
 
An Introduction to seo and How it Works?
An Introduction to seo and How it Works?An Introduction to seo and How it Works?
An Introduction to seo and How it Works?
 
SEO-Presentation-2023.pptx
SEO-Presentation-2023.pptxSEO-Presentation-2023.pptx
SEO-Presentation-2023.pptx
 
Off page seo
Off page seo Off page seo
Off page seo
 
Link building ppt
Link building pptLink building ppt
Link building ppt
 
Google Keyword Planner - New Keyword Research Tool by Google
Google Keyword Planner - New Keyword Research Tool by GoogleGoogle Keyword Planner - New Keyword Research Tool by Google
Google Keyword Planner - New Keyword Research Tool by Google
 
Do follow and no-follow link
Do follow and no-follow linkDo follow and no-follow link
Do follow and no-follow link
 
Seo presentation
Seo presentationSeo presentation
Seo presentation
 
CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations
 
Off-Page SEO Tactics
Off-Page SEO TacticsOff-Page SEO Tactics
Off-Page SEO Tactics
 
Search Engine Marketing
Search Engine MarketingSearch Engine Marketing
Search Engine Marketing
 
Up to Speed on HTML 5 and CSS 3
Up to Speed on HTML 5 and CSS 3Up to Speed on HTML 5 and CSS 3
Up to Speed on HTML 5 and CSS 3
 
Css position
Css positionCss position
Css position
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
jQuery
jQueryjQuery
jQuery
 
Angular Lifecycle Hooks
Angular Lifecycle HooksAngular Lifecycle Hooks
Angular Lifecycle Hooks
 
Website performance optimization
Website performance optimizationWebsite performance optimization
Website performance optimization
 
SEO Portfolio
SEO PortfolioSEO Portfolio
SEO Portfolio
 
Seo
SeoSeo
Seo
 
Client side scripting and server side scripting
Client side scripting and server side scriptingClient side scripting and server side scripting
Client side scripting and server side scripting
 

Destacado

EDF2013: Big Data Tutorial: Marko Grobelnik
EDF2013: Big Data Tutorial: Marko GrobelnikEDF2013: Big Data Tutorial: Marko Grobelnik
EDF2013: Big Data Tutorial: Marko GrobelnikEuropean Data Forum
 
Semantic Wiki For The Enterprise
Semantic Wiki For The EnterpriseSemantic Wiki For The Enterprise
Semantic Wiki For The EnterpriseJosef Holy
 
The django book - Chap10 : Advanced Models
The django book - Chap10 : Advanced ModelsThe django book - Chap10 : Advanced Models
The django book - Chap10 : Advanced ModelsSpin Lai
 
Building Dynamic Websites With Joomla CMS
Building Dynamic Websites With Joomla CMSBuilding Dynamic Websites With Joomla CMS
Building Dynamic Websites With Joomla CMSThomas Siegers
 
Integrating CMS and eCommerce platforms
Integrating CMS and eCommerce platformsIntegrating CMS and eCommerce platforms
Integrating CMS and eCommerce platformsPerttu Tolvanen
 
Django rest framework tips and tricks
Django rest framework   tips and tricksDjango rest framework   tips and tricks
Django rest framework tips and tricksxordoquy
 
IBM Cognos TM1 Version 10.1 Demonstration and Financial Planning Best Practic...
IBM Cognos TM1 Version 10.1 Demonstration and Financial Planning Best Practic...IBM Cognos TM1 Version 10.1 Demonstration and Financial Planning Best Practic...
IBM Cognos TM1 Version 10.1 Demonstration and Financial Planning Best Practic...Senturus
 
What is a Content Management System or CMS
What is a Content Management System or CMSWhat is a Content Management System or CMS
What is a Content Management System or CMSSteve Williams
 
International marketing (1)
International marketing (1)International marketing (1)
International marketing (1)Ganpurev Ganbold
 
An Overview of Models in Django
An Overview of Models in DjangoAn Overview of Models in Django
An Overview of Models in DjangoMichael Auritt
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesMatt Harrison
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to PythonNowell Strite
 

Destacado (15)

Developing a Solid Content Strategy
Developing a Solid Content StrategyDeveloping a Solid Content Strategy
Developing a Solid Content Strategy
 
EDF2013: Big Data Tutorial: Marko Grobelnik
EDF2013: Big Data Tutorial: Marko GrobelnikEDF2013: Big Data Tutorial: Marko Grobelnik
EDF2013: Big Data Tutorial: Marko Grobelnik
 
Semantic Wiki For The Enterprise
Semantic Wiki For The EnterpriseSemantic Wiki For The Enterprise
Semantic Wiki For The Enterprise
 
Cognos Software Development Kit
Cognos Software Development KitCognos Software Development Kit
Cognos Software Development Kit
 
The django book - Chap10 : Advanced Models
The django book - Chap10 : Advanced ModelsThe django book - Chap10 : Advanced Models
The django book - Chap10 : Advanced Models
 
Building Dynamic Websites With Joomla CMS
Building Dynamic Websites With Joomla CMSBuilding Dynamic Websites With Joomla CMS
Building Dynamic Websites With Joomla CMS
 
Integrating CMS and eCommerce platforms
Integrating CMS and eCommerce platformsIntegrating CMS and eCommerce platforms
Integrating CMS and eCommerce platforms
 
Django rest framework tips and tricks
Django rest framework   tips and tricksDjango rest framework   tips and tricks
Django rest framework tips and tricks
 
IBM Cognos TM1 Version 10.1 Demonstration and Financial Planning Best Practic...
IBM Cognos TM1 Version 10.1 Demonstration and Financial Planning Best Practic...IBM Cognos TM1 Version 10.1 Demonstration and Financial Planning Best Practic...
IBM Cognos TM1 Version 10.1 Demonstration and Financial Planning Best Practic...
 
Marketing Management Notes Unit I
Marketing Management Notes   Unit   IMarketing Management Notes   Unit   I
Marketing Management Notes Unit I
 
What is a Content Management System or CMS
What is a Content Management System or CMSWhat is a Content Management System or CMS
What is a Content Management System or CMS
 
International marketing (1)
International marketing (1)International marketing (1)
International marketing (1)
 
An Overview of Models in Django
An Overview of Models in DjangoAn Overview of Models in Django
An Overview of Models in Django
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 Minutes
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 

Similar a Dynamic Models with Django

Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoKnoldus Inc.
 
Introduction to django framework
Introduction to django frameworkIntroduction to django framework
Introduction to django frameworkKnoldus Inc.
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoAhmed Salama
 
Graph Gurus 15: Introducing TigerGraph 2.4
Graph Gurus 15: Introducing TigerGraph 2.4 Graph Gurus 15: Introducing TigerGraph 2.4
Graph Gurus 15: Introducing TigerGraph 2.4 TigerGraph
 
Customizing the Django Admin
Customizing the Django AdminCustomizing the Django Admin
Customizing the Django AdminLincoln Loop
 
Agile methodologiesvswaterfall
Agile methodologiesvswaterfallAgile methodologiesvswaterfall
Agile methodologiesvswaterfallMuthu Natarajan
 
Web Traffic Time Series Forecasting
Web Traffic  Time Series ForecastingWeb Traffic  Time Series Forecasting
Web Traffic Time Series ForecastingBillTubbs
 
Django interview Questions| Edureka
Django interview  Questions| EdurekaDjango interview  Questions| Edureka
Django interview Questions| EdurekaEdureka!
 
TextEditor - Designing open source apps
TextEditor - Designing open source appsTextEditor - Designing open source apps
TextEditor - Designing open source appsRichard L Caceres
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014Simona Clapan
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Alessandro Molina
 
Bootiful Reactive Testing - Mario Gray
Bootiful Reactive Testing - Mario GrayBootiful Reactive Testing - Mario Gray
Bootiful Reactive Testing - Mario GrayVMware Tanzu
 
How To Transform the Manual Testing Process to Incorporate Test Automation
How To Transform the Manual Testing Process to Incorporate Test AutomationHow To Transform the Manual Testing Process to Incorporate Test Automation
How To Transform the Manual Testing Process to Incorporate Test AutomationRanorex
 
Agile - Scrum Presentation
Agile - Scrum PresentationAgile - Scrum Presentation
Agile - Scrum Presentationgihanlsw
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumLiraz Shay
 
What are the basic key points to focus on while learning Full-stack web devel...
What are the basic key points to focus on while learning Full-stack web devel...What are the basic key points to focus on while learning Full-stack web devel...
What are the basic key points to focus on while learning Full-stack web devel...kzayra69
 
Django Workflow and Architecture
Django Workflow and ArchitectureDjango Workflow and Architecture
Django Workflow and ArchitectureAndolasoft Inc
 

Similar a Dynamic Models with Django (20)

Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Introduction to django framework
Introduction to django frameworkIntroduction to django framework
Introduction to django framework
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Graph Gurus 15: Introducing TigerGraph 2.4
Graph Gurus 15: Introducing TigerGraph 2.4 Graph Gurus 15: Introducing TigerGraph 2.4
Graph Gurus 15: Introducing TigerGraph 2.4
 
Droidcon Paris 2015
Droidcon Paris 2015Droidcon Paris 2015
Droidcon Paris 2015
 
Customizing the Django Admin
Customizing the Django AdminCustomizing the Django Admin
Customizing the Django Admin
 
Agile methodologiesvswaterfall
Agile methodologiesvswaterfallAgile methodologiesvswaterfall
Agile methodologiesvswaterfall
 
Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013
 
Web Traffic Time Series Forecasting
Web Traffic  Time Series ForecastingWeb Traffic  Time Series Forecasting
Web Traffic Time Series Forecasting
 
Django interview Questions| Edureka
Django interview  Questions| EdurekaDjango interview  Questions| Edureka
Django interview Questions| Edureka
 
TextEditor - Designing open source apps
TextEditor - Designing open source appsTextEditor - Designing open source apps
TextEditor - Designing open source apps
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2
 
Bootiful Reactive Testing - Mario Gray
Bootiful Reactive Testing - Mario GrayBootiful Reactive Testing - Mario Gray
Bootiful Reactive Testing - Mario Gray
 
Types of models
Types of modelsTypes of models
Types of models
 
How To Transform the Manual Testing Process to Incorporate Test Automation
How To Transform the Manual Testing Process to Incorporate Test AutomationHow To Transform the Manual Testing Process to Incorporate Test Automation
How To Transform the Manual Testing Process to Incorporate Test Automation
 
Agile - Scrum Presentation
Agile - Scrum PresentationAgile - Scrum Presentation
Agile - Scrum Presentation
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and Selenium
 
What are the basic key points to focus on while learning Full-stack web devel...
What are the basic key points to focus on while learning Full-stack web devel...What are the basic key points to focus on while learning Full-stack web devel...
What are the basic key points to focus on while learning Full-stack web devel...
 
Django Workflow and Architecture
Django Workflow and ArchitectureDjango Workflow and Architecture
Django Workflow and Architecture
 

Último

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Dynamic Models with Django

  • 1. Dynamic Models in Django Juergen Schackmann j.schackmann@reliatec.de
  • 2. © Juergen Schackmann 2013 2/28 Me ▸ Python & Django since 4 years ▸ reliatec.de since 3 months ▸ Django Web Applications ▸ Focus: EDC systems for clinical studies & Telemonitoring
  • 3. © Juergen Schackmann 2013 3/28 Objective ▸ Why do do we care about Django Dynamic Models? ▸ Why do we have to talk about them? ▸ What should we do about them?
  • 5. © Juergen Schackmann 2013 5/28 Models in a Django project Phase1: Code Development Models and model attributes are defined by implementing those with Python code Phase 2: Deployment Underlying database tables and columns are created by running “syncdb” command Phase 3: Runtime Models / DB Tables are populated with content as part of the user interactions
  • 6. © Juergen Schackmann 2013 6/28 Problem? There is no way to adapt the Django Models at runtime based on user interactions ▸ Django Models are defined and implemented during development phase ▸ Django Models are expected to be static after deployment ▸ Django DB Backends only fully support SQL databases, i.e. a schema is required ▸ DB specific solutions limit adoption rate of any reusable App
  • 7. Use Cases for Dynamic Models
  • 8. © Juergen Schackmann 2013 8/28 Custom Content Types for a CMS* * system: dotCms (Java); source: http://dotcms.com/
  • 9. © Juergen Schackmann 2013 9/28 Customized Products for an Ecommerce Shop* * system: Magento (PHP); source: averybrandandprint.co.uk
  • 10. © Juergen Schackmann 2013 10/28 Clinical Research Forms* * system: OpenClinica (Java); source: openclinica.com
  • 11. © Juergen Schackmann 2013 11/28 Problem? Which Problem? ▸ Models / Content Types are domain or site specific ▸ Neither realistic nor efficient to implement all thinkable content types into a software product ▸ Configuration by subject-matter experts is better, than code customization by developers ▸ Dynamic Models reduce the number of deployment cycles
  • 13. © Juergen Schackmann 2013 13/28 As a User, I ... ▸ want to maintain my dynamic models easily without understanding any Django Model details ▸ want extend existing (static) models without thinking about static and dynamic parts ▸ do not want to think about performance, when creating my custom fields ▸ I want to be able to query/search for certain information seamlessly over static and dynamic models
  • 14. © Juergen Schackmann 2013 14/28 As a developer, I ... ▸ want my dynamic models to be integrated with Django Standard Tools (admin, migrations, reversion) out of the box ▸ want to apply the same API that I use for the static models ▸ do not want to use or be limited to specific databases, but use the standard Django backends ▸ want to have a customizable front-end for my users to manage the dynamic models
  • 15. © Juergen Schackmann 2013 15/28 Evaluation Criteria ▸ Performance ▸ “Querybility” ▸ Django Standard Tools Integration (Admin, Cache, ...) ▸ Supported Backend ▸ Complexity/ Maintainability
  • 16. © Juergen Schackmann 2013 16/28 Entity Attribute Value (EAV) Transform your table columns into table rows Attribute 1 Attribute 2 Attribute n Table Attribute Name Attribute Value Attribute TableTable has1 n
  • 17. © Juergen Schackmann 2013 17/28 EAV Django Apps ▸ bitbucket.org/neithere/eav-django/ ▸ github.com/mvpdev/django-eav
  • 18. © Juergen Schackmann 2013 18/28 Serialized Dictionary Transform your table columns into pickeld or jsoned dictionaries Attribute 1 Attribute 2 Attribute n Table Dictionary String Attributes {“attribute1”:”a”, “attribute2”: 5, “attribute3”:[1,2] }
  • 19. © Juergen Schackmann 2013 19/28 Serialized Dictionary Django Apps Fields ▸ bitbucket.org/schinckel/django-jsonfield/ ▸ github.com/bradjasper/django-jsonfield ▸ github.com/derek-schaefer/django-json-field ▸ github.com/shrubberysoft/django-picklefield App ▸ github.com/dobarkod/django-dynamic-model
  • 20. © Juergen Schackmann 2013 20/28 Runtime Schema Updates Update Django models and database schema at runtime using ▸ syncdb functionality ▸ South functionality ▸ eventually: Andrew Godwin's “Schema Migrations for Django”
  • 21. © Juergen Schackmann 2013 21/28 Runtime Schema Update Django Apps Update Django models and database schema at runtime using ▸ Syncdb ▸ bitbucket.org/mhall119/dynamo/overview ▸ South ▸ github.com/willhardy/dynamic-models ▸ github.com/willhardy/django-dymo ▸ bitbucket.org/schacki/django-dynamo ▸ github.com/charettes/django-mutant ▸ Schema Migrations ▸ github.com/charettes/django-mutant
  • 22. © Juergen Schackmann 2013 22/28 Database specific solutions Hstore ▸ github.com/jordanm/django-hstore ▸ postgresql.org/docs/9.0/static/hstore.html No SQL ▸ github.com/django-nonrel ▸ github.com/pydanny/django-mongonaut
  • 23. © Juergen Schackmann 2013 23/28 Summary EAV Serialization Schema Updates Performance    Querybility    Django Standard Tools  /  Supported Backend    Complexity/ Maintainability   
  • 24. © Juergen Schackmann 2013 24/28 Schema Update most powerful, but ... ▸ Name clashes between developer models and dynamic models (especially with schema migrations) ▸ Multiple Users updating the same model (possibly even conflicting) ▸ Orphan database elements ▸ Dynamic Model loading at startup ▸ How to find/inject dynamic models into views and templates
  • 26. © Juergen Schackmann 2013 26/28 Must have components of a Dynamic Model Application ▸ Meta Model Front End to let users maintain their meta models ▸ Meta Model Representation to store the meta model information ▸ Meta Model Analyzer to detect changes that require some further actions (for schema, admin or model) ▸ Schema Sync Manager to update and sync the database schema ▸ Admin Sync Manager to update and sync the Django admin ▸ Model/Cache Sync Manager to update and sync the Django models and model cache
  • 27. © Juergen Schackmann 2013 27/28 More resources on dynamic models ▸ code.djangoproject.com/wiki/DynamicModels ▸ djangopackages.com/grids/g/forms/ ▸ stackoverflow.com/questions/7933596/django-dynamic-model- fields/7934577
  • 28. Thank you very much! Questions please?