Changes between Version 1 and Version 2 of Ticket #27446


Ignore:
Timestamp:
Nov 5, 2016, 9:45:24 AM (8 years ago)
Author:
Ben Cole
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27446 – Description

    v1 v2  
    11There exist multiple use cases where a database will generate values for a field/column. Most RDBMSes expect that these columns be excluded from from `INSERT` and `UPDATE` statements. However they still need to be included in `SELECT` statements.
     2
     3Examples include the PostgreSQL `serial` data type, triggers and functions that generate defaults on `INSERT` (such as PostgreSQL `UUID`)
    24
    35The proposal therefore is to add a `readonly` option to the base `Field` class that when `True` would strip these fields from being compiled to SQL during `INSERT`s and `UPDATE`s. This allows for a very simple change that covers all possible write queries that Django may perform (including bulk_*).
Back to Top