#24565: server_default option on model fields
----------------------------------------------+--------------------
Reporter: Pacodastre | Owner: nobody
Type: New feature | Status: new
Component: Database layer (models, ORM) | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
I'll just be talking about PostgreSQL, since it's the only one i've been
using, but it might also be possible with other Database Engines.
When you set a default on a field such as:
{{{
my_field = models.BooleanField(default=True)
}}}
This default is not applied to the PostgreSQL table:
{{{
Table "public.app_mytable"
Column | Type | Modifiers
-----------------+--------------------------+-----------
my_field | boolean | not null
}}}
SQLAlchemy provides a
[http://docs.sqlalchemy.org/en/latest/core/defaults.html#server-side-
defaults server_default] option.
It would be nice to have such an option in Django too.
--
Ticket URL: <https://code.djangoproject.com/ticket/24565>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.d17b7a89898640f9ca13d8007f5bda03%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.