Top "Django-validation" questions

django-validation refers to form and field validation tools provided by Django out of the box

What's the best way to store Phone number in Django models

I am storing a phone number in model like this: phone_number = models.CharField(max_length=12) User would enter a …

django django-forms django-validation
Custom form validation

I have a pretty simple form: from django import forms class InitialSignupForm(forms.Form): email = forms.EmailField() password = forms.CharField(…

django django-forms django-validation
Django TextField max_length validation for ModelForm

Django does not respect the max_length attribute of TextField model field while validating a ModelForm. So I define a …

django django-models django-forms django-validation
Custom validation in Django admin

I have a very simple Django app in order to record the lectures given my colleagues.Since it is quite …

python django django-forms django-admin django-validation
Why doesn't django's model.save() call full_clean()?

I'm just curious if anyone knows if there's good reason why django's orm doesn't call 'full_clean' on a model …

python django django-models django-validation
Is save() called implicitly when calling create in django?

I'm trying to perform some custom validation on a model and I'm getting confused. Let me be specific. Let's say …

django django-models django-validation
Adding css class to field on validation error in django

I am using Django's modelform and its really good. How can I highlight the actual text box (e.g. border:…

python django django-forms django-validation django-media
Django - form Clean() and field errors

I'm trying to set field errors in a form clean() and I'm currently doing: self._errors['address'] = self._errors.get(…

django validation django-forms django-validation
Django unique_together with nullable ForeignKey

I'm using Django 1.8.4 in my dev machine using Sqlite and I have these models: class ModelA(Model): field_a = CharField(…

django django-models django-forms django-validation
Django: Overriding the clean() method in forms - question about raising errors

I've been doing things like this in the clean method: if self.cleaned_data['type'].organized_by != self.cleaned_data[…

django django-forms django-validation