[Django] #33135: Read-only parameter for model fields

8 views
Skip to first unread message

Django

unread,
Sep 24, 2021, 3:55:51 AM9/24/21
to django-...@googlegroups.com
#33135: Read-only parameter for model fields
-------------------------------------+-------------------------------------
Reporter: mkalioby | Owner: nobody
Type: New | Status: new
feature |
Component: Database | Version:
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
New DBMS provides virtual columns that are generated based on another
column value in the row, these fields are read-only from DBMS prospective,
so they shouldn’t be included in insert or update statements.

My suggestion is to add **read-only** flag to the BaseField class and if
the flag is true, it shall be skipped from insert/update and can be
selected as usual.

I can do it, if the community will accept it.

--
Ticket URL: <https://code.djangoproject.com/ticket/33135>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 24, 2021, 4:23:03 AM9/24/21
to django-...@googlegroups.com
#33135: Read-only parameter for model fields
-------------------------------------+-------------------------------------
Reporter: mkalioby | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* version: => dev
* resolution: => duplicate


Comment:

Thanks for this ticket.
[https://code.djangoproject.com/ticket/31300#comment:1 Generated/Function-
based virtual columns] are a big topic. I don't think it's worth adding
partial support and force users to maintain them manually.

Duplicate of #31300.

--
Ticket URL: <https://code.djangoproject.com/ticket/33135#comment:1>

Django

unread,
Sep 24, 2021, 4:23:46 AM9/24/21
to django-...@googlegroups.com
#33135: Add read_only parameter to Model fields for virtual columns.

-------------------------------------+-------------------------------------
Reporter: mkalioby | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/33135#comment:2>

Reply all
Reply to author
Forward
0 new messages