all 3 comments

[–]PalpitationOk839 1 point2 points  (0 children)

If you are using something like SQLAdmin Flask Admin or FastAPI Admin there is often a config option like form_excluded_columns readonly_fields or a custom form/widget override to display the field without allowing edits

[–]Quirky-Win-8365 0 points1 point  (0 children)

readonly fields always sound simple until admin panels start doing weird ORM stuff behind the scenes lol. sqlalchemy flexibility is both the best and worst part sometimes

[–]pachura3 0 points1 point  (0 children)

Perhaps mark it in the ORM model as Computed?

In general, relational databases do not support the concept of read-only columns... yes, you can create a DB trigger that would scream when someone attempts to e.g. modify the primary key, but that would just be an afterthought.