aboutsummaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d/snippets/python-mode/form_valid
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-09-08 14:56:51 -0700
committerGravatar Tom Willemse2026-09-08 14:56:51 -0700
commit5fd4013f4565fb7f00c00c25490a263116042a08 (patch)
tree8cb21cdc74bc311b3ac43aa51d70a12b5f835625 /emacs/.emacs.d/snippets/python-mode/form_valid
parent80fa614c3ca653228c2f32b39bf7cd8f37864bd9 (diff)
downloadnew-dotfiles-5fd4013f4565fb7f00c00c25490a263116042a08.tar.gz
new-dotfiles-5fd4013f4565fb7f00c00c25490a263116042a08.zip
emacs: Add snippets
Diffstat (limited to 'emacs/.emacs.d/snippets/python-mode/form_valid')
-rw-r--r--emacs/.emacs.d/snippets/python-mode/form_valid8
1 files changed, 8 insertions, 0 deletions
diff --git a/emacs/.emacs.d/snippets/python-mode/form_valid b/emacs/.emacs.d/snippets/python-mode/form_valid
new file mode 100644
index 0000000..c5a7e58
--- /dev/null
+++ b/emacs/.emacs.d/snippets/python-mode/form_valid
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: Record form
+# key: defm
+# --
+@record_activity(model=${1:`(progn (re-search-backward "^[ \t]*model = \\([a-zA-Z_].*\\)$") (match-string 1))`})
+def form_valid(self, form):
+ '''Make sure any changes to the $1 model get logged.'''
+ return super(${2:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).form_valid(form) \ No newline at end of file