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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
35
🐍 ❤️ 🦀 — Python loves Rust
markush
0
290
Knock! Knock! Who's There?
markush
0
100
An Introduction To Kubernetes ☸
markush
0
140
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
78
Logging Rethought 2: The Actions of Frank Taylor Jr. (PyCon Australia 2019)
markush
1
240
Other Decks in Technology
See All in Technology
キャリアの中で本を作る / Making a Book During Your Career
ak1210
0
130
LLM/Agent評価:トップ営業の発言を「正解」にする 〜暗黙的正解による評価を営業資産に変える〜
takkuhiro
1
180
依頼文化をやめる日 EM視点で語るPlatform EngineeringとInclusive SRE / Discussing Platform Engineering and Inclusive SRE from an EM's Perspective
shin1988
4
5.1k
AIレビューはどこまで任せられるのか?自動化と人が背負うレビューの境界
sansantech
PRO
2
480
環境凍結という Toil を倒す -セルフサービス型 Ephemeral テスト環境の 設計と実践
shirouz
1
2.2k
証券システムを10年Scalaで作り続けるということ - 関数型まつり2026
krrrr38
3
830
SRE Next 2026 何でも屋からの脱却
bto
0
530
「早く出す」より「事業に効く」 ── 顧客の業務サイクルから逆算するAI時代の二重ループ開発と「変化の設計者」 / devsumi2026
rakus_dev
0
140
SRE Lounge Hiroshimaへの招待
grimoh
0
610
AIに「使われる」時代のSaaS戦略 〜既存WebAPIのMCPサーバー化における開発ノウハウ〜
ekispert_api
0
310
「ちゃんとやっている」は独りよがりだった ― 不安に寄り添うインシデント対応へ / Towards incident response that addresses anxieties
chmikata
1
4.7k
ループエンジニアリングでE2Eテストを実践
noriyukitakei
0
340
Featured
See All Featured
KATA
mclloyd
PRO
35
15k
Faster Mobile Websites
deanohume
310
32k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
The browser strikes back
jonoalderson
0
1.4k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
170
How STYLIGHT went responsive
nonsquared
100
6.2k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
210
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
460
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