Skip to content
Advertisement

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: 127.0.0.1:8000). 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 manage.py 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. forms.py This is the html in question. I’ve

Why am I getting django.db.models error telling me I have no attribute for TextChoices in Django (3.1.6) and Python(3.8)?

thanks so much for reading. I’ve got this running on my computer no problem. It’s working on my VS on Windows 10. But this error keeps coming up, it looks like TextChoices is no longer usable? AttributeError: module ‘django.db.models’ has no attribute ‘TextChoices’ I’m putting it u0p on PythonAnywhere, Python 3.8, and Django 3.1.6 I am still new at this,

Selenium + Python – entering text in form with no label/id?

I”m trying to enter some text in the box as shown below. I’ve narrowed the element down to SMDMainText. I’ve tried numerous ways of finding the element, however when I try to send_keys(), the result is that I get the error “element not interactable”. The issue that I’m facing is that I’m trying to find an element called <input automplete=”on”>

Advertisement