Changes between Version 1 and Version 2 of Ticket #27446
- Timestamp:
- Nov 5, 2016, 9:45:24 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27446 – Description
v1 v2 1 1 There 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 3 Examples include the PostgreSQL `serial` data type, triggers and functions that generate defaults on `INSERT` (such as PostgreSQL `UUID`) 2 4 3 5 The 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_*).