From e284370c4bc81844b08574afb4bb343de6e83145 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 9 Mar 2022 19:41:46 -0600 Subject: [PATCH] Add `Form.insert()` method, to insert field based on index --- tailbone/forms/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tailbone/forms/core.py b/tailbone/forms/core.py index 98d11a45..3d87cee7 100644 --- a/tailbone/forms/core.py +++ b/tailbone/forms/core.py @@ -447,6 +447,9 @@ class Form(object): def append(self, field): self.fields.append(field) + def insert(self, index, field): + self.fields.insert(index, field) + def insert_before(self, field, newfield): self.fields.insert_before(field, newfield)