Last Updated : 12 Jul, 2025
Built-in Field Validations in Django models are the validations that come predefined to all Django fields. Every field comes in with built-in validations from Django
validators. One can also add more built-in field validations for applying or removing certain constraints on a particular field.
editable=False
will make the field
disappear from all forms including admin and ModelFormi.e., it can not be edited using any form. The field will not be displayed in the admin or any other ModelForm. They are also skipped during
model validation.
Syntaxfield_name = models.Field(editable = False)Django Built-in Field Validation
editable=False
Explanation
Illustration of
editable=Falseusing an Example. Consider a project named
geeksforgeeks
having an app named
geeks
.
Refer to the following articles to check how to create a project and an app in Django.
Enter the following code into
models.py
file of
geeksapp. We will be using CharField for experimenting for all field options.
Python3
from django.db import models
from django.db.models import Model
# Create your models here.
class GeeksModel(Model):
geeks_field = models.CharField(
max_length = 200,
default = "GFG is best",
editable = False
)
After running makemigrations and migrate on Django and rendering the above model, let us try to create an instance from Django admin interface. You can see that field doesn't appear in admin interface. Hit
Save.
Let us check in admin interface if the instance of model is created.
Therefore, editable=False modifies the field so that it is not visible to admin interface.
Advanced Concepts with defaulteditable=False
is generally used to hide some fields such as some encrypted code or email address verification code etc from admin panel. To use editable in a field you must specify either of following settings:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4