#33016: Cannot override choices error_messages in model
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
suneethdev |
Type: | Status: new
Uncategorized |
Component: Database | Version: 3.2
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I have a model class (from django.db.model) and a char field with choices
attribute, my form is not created from django form and i am using a
serializer in the middle of the model and my static HTML form when
validating my choices field (dropdown) it shows the default validation
messages only, i couldn't override the error messages. Thanks in advance.
here is my code
class CustomUser(BaseModel, AbstractUser):
type = models.CharField(choices=TYPES, max_length=20,
default='super_admin',error_messages={"null":'Value is not a
valid.',"blank":'Value is not a valid.',"invalid_choice":'Value is not a
valid.'})
note: Base model inherited from models.Model
--
Ticket URL: <https://code.djangoproject.com/ticket/33016>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.323f35a2dfb61bcad46343e3e022d858%40djangoproject.com.