Skip to content

Tag: forms

Edit Form Submit handler for a Model

I have a fairly simple django model in a Wagtail CMS; essentially: I need to perform an action when this model is saved via the Wagtail model edit form (eg /admin/section/thingy/123/edit). Currently, I have registered a post_save signal, however this has resulted in the method being called when the model is saved programmatically (via an import sync task). I’ve had

No Django POST data when sent over a form?

I am on a development server (no CSRF protection), sending over login data to Django via a web form (Django: HTML: Django: I’m pretty sure that the POST data is not being transmitted (TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘str’) in the print statement, but I can’t figure out why. (The HTML is on localhost and the

Django Rendering Form in HTML Issue

I’m attempting to render a form, in html and have tried the normal {{ form }}. However when I go to the site set up by: python runserver. I get the following where the form should go (highlighted section on screen-capture) webpage This is the code for the form in question. This is the html in question. I’ve

Django – dropdown form with multiple select

I need guidance building a django dropdown forms.Form field in which I can select multiple choices. I need to select multiple locations on the office field of the form. When submitted, the form needs to return a list of the chosen offices (e.g. [“New York”, “Los Angeles”] or [“Austin”]). Returning a tuple is also acceptable. The best I can do