Hi Jim, thanks for answer but:
when I set writable and readable in models.py or controllers.py it is hidden indeed but even I set:
user = auth.get_user()
form = Form(db.main)
db.main.creator_id.writable = False
db.main.creator_id.readable = False
form.vars["creator_id"] = user['id']
if form.accepted:
redirect(URL("index"))
it saves null to DB to creator_id field. Maybe bad approach but I
don't know how to set it correctly at the moment.
AFAIK hidden parameter adds hidden fields to form but I wanna hide and set some fields from db.
Thanks, Shawn
--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/16584f57-5c11-44bc-b682-79f8d3ae70a3o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/d5bb4edc-aad0-4e11-9890-9d41fcf6990eo%40googlegroups.com.
Thanks Massimo,
but my situation:
I need to save field to db (the field is defined in models) but
hide field from user and set it in controller.
I see no way at the moment.
Thanks, Shawn
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/D72F96FA-7955-4461-A2EE-C7DECD41D6D5%40gmail.com.
user = auth.get_user()
form = Form(
Field('my_field_1),
Field('other_fields),
...
)
if form.accepted:
db.main.insert("creator_id"=user["id"], "my_field_1"=form.vars.my_field_1, "other_fields"=form.vars.other_fields)
redirect(URL("index"))
Massimo
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/16584f57-5c11-44bc-b682-79f8d3ae70a3o%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/d5bb4edc-aad0-4e11-9890-9d41fcf6990eo%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.