Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
“Forms are static” – “No, they aren't”
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Markus H
June 02, 2015
Technology
10k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
“Forms are static” – “No, they aren't”
My talk from DjangoCon Europe 2015 in Cardiff, Wales
Markus H
June 02, 2015
More Decks by Markus H
See All by Markus H
Oh, I Found a Security Issue (reloaded 2026)
markush
0
36
🐍 ❤️ 🦀 — Python loves Rust
markush
0
290
Knock! Knock! Who's There?
markush
0
100
An Introduction To Kubernetes ☸
markush
0
150
Writing Safe Database Migrations (DjangoCon Europe 2021)
markush
0
14k
A Pony On The Move: How Migrations Work In Django 🐎
markush
0
13k
All Hands on Deck — Handling Security Issues
markush
0
14k
Logging Rethought 2: The Actions of Frank Taylor Jr. (PyCon UK 2019)
markush
0
83
Logging Rethought 2: The Actions of Frank Taylor Jr. (PyCon Australia 2019)
markush
1
240
Other Decks in Technology
See All in Technology
『三匹の子ぶた』から学ぶネットワークセキュリティの昔と今 / Network Security: Then and Now Through the Lens of The Three Little Pigs
nttcom
1
1.6k
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
8
7.5k
toio・myCobotでフィジカルAIっぽいことを行うための検討(とりあえず調査) / フィジカルAI LT(IoTLTによる開催)
you
PRO
0
270
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
19k
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
[ChatGPT Work LT]事務作業が苦手な人のための バックオフィスの「半」自動化
chimaki_iot
0
150
MIRU 2026 チュートリアル
keisuke198619
0
760
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
53k
今こそ聞きたいソフトウェア設計 ドメイン駆動設計再入門
masuda220
PRO
12
4.2k
脱Jenkins、インターン生が挑んだCIツールGitHubActions移行
mixi_engineers
PRO
1
330
AIがコードを書く時代、人間は何を保証するのか———馬場さんと考える、開発者に求められる新しい責任と価値 - TECH PLAY
netmarkjp
0
1.2k
実践が先生だった— 新卒サーバーエンジニア1年目のリアル
mixi_engineers
PRO
0
250
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Docker and Python
trallard
47
4k
The Invisible Side of Design
smashingmag
301
52k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.9k
Tell your own story through comics
letsgokoyo
1
1k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
230
Site-Speed That Sticks
csswizardry
13
1.4k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Embracing the Ebb and Flow
colly
88
5.1k
Claude Code のすすめ
schroneko
67
230k
Transcript
“Forms are static” – “No, they aren't”
Hi, I’m Markus Holtermann • Django Core Developer • CS
MSc Student @m_holtermann • github.com/MarkusH • markusholtermann.eu
Forms are static
What does “static” even mean?
What about request dependent forms?
They are static too!
What are non-static forms then?
Why do you need them?
How does that work?
def modelform_factory(model, …): attrs = { ‘fields’: fields_for_model(model), ‘model’: model,
} Meta = type(str('Meta'), (object,), attrs) class_attrs = {‘Meta’: Meta} class_name = model.__name__ + str('Form') return type( class_name, ModelForm, class_attrs )
Wait! Aren’t they still static?
type(name, bases, attrs) rocks!
django-dynamic-forms http://django-dynamic-forms.rtfd.org
Actions FormModel Name URLs Name FormFieldModel Options Label … …
belongs to
@formmodel_action('Send to admins') def send_admins(form_model, form, request): # label →
value mapped_data = form.get_mapped_data() # construct message message = render_to_string( 'dynamic_forms/email.txt', { 'form': form_model, 'data': mapped_data}) # send data via mail mail_admins( “New form submission”, message )
@dynamic_form_field class IntegerField(BaseDynamicFormField): cls = 'django.forms.EmailField' display_label = 'Email' class
Meta: # attribute = [type, default, class] max_value = [int, None, forms.IntegerField] min_value = [int, None, forms.IntegerField]
None
None
None
django-dynamic-forms http://django-dynamic-forms.rtfd.org
Thank You! @m_holtermann • github.com/MarkusH • markusholtermann.eu