Skip to content

Read only and prepopulated fields in custom edit forms #326

Answered by gi0baro
KellerKev asked this question in Q&A
Discussion options

You must be logged in to vote

With the same order:

  1. In Emmett the parameter is rw (https://emmett.sh/docs/2.2.x/orm/models#fields-accessibility), which accepts a boolean (in case you want to set both readability and writability to True or False) or a tuple ((True, False) means readable but not writable).
  2. Field has a default parameter as well in Emmett (https://emmett.sh/docs/2.2.x/orm/models#default-values). In case you use ORM and models, probably using Model.form(record) is easier (https://emmett.sh/docs/2.2.x/forms#forms-with-database-entities)
  3. It is not documented, but forms in Emmett have the same custom flow of web2py (code ref: https://github.com/emmett-framework/emmett/blob/master/emmett/forms.py#L197#L233), s…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by KellerKev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants