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
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
38
🐍 ❤️ 🦀 — Python loves Rust
markush
0
300
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
85
Logging Rethought 2: The Actions of Frank Taylor Jr. (PyCon Australia 2019)
markush
1
240
Other Decks in Technology
See All in Technology
AIのためのEthernet技術動向 (SerDes)
markunet
1
310
内製AIチャットボット開発で学んだ Datadog Agent Observability活用術
mkdev10
0
130
カーネルまで探検して理解するふたつの自動計装
sumiyae
0
290
35分でわかるEffective Platform Engineering
nwiizo
5
630
1.5時間を無駄にして学んだwsl2におけるaptとsnapの選択と仕組み
yosaka0123
0
420
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
12
85k
RelayerというPHPのフレームワークを作った
polidog
PRO
0
130
英語が話せなくてもKubeConスタッフに参加した話
yusuke427
2
1.1k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.2k
アクセスキーが漏れた日にやるべきこと- 無効化の先にある本当の対応
kazzpapa3
0
300
トークンマネジメントでAIにとって働きやすい環境を実現する
hikaruegashira
0
150
平文パスワードはログに“残り” ── 肝心の侵入は“痕跡すら残らない”
kuroneko13
0
130
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.8k
[SF Ruby Conf 2025] Rails X
palkan
2
1.3k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
260
Scaling GitHub
holman
464
140k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
ラッコキーワード サービス紹介資料
rakko
1
4.5M
Rails Girls Zürich Keynote
gr2m
96
14k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
410
Building AI with AI
inesmontani
PRO
1
1.2k
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