default value for a field?

5 views
Skip to first unread message

Terrence Brannon

unread,
Oct 21, 2018, 1:20:10 AM10/21/18
to Reahl discuss
My question is: where do I set a default value for a Field? When the field is rendered in an input element, I want a default value there, not just a placeholder.

Taking the "separator" Field on line 29 here:

my question is where do I set a default value for it and how?

Perhaps it's when I render it like here:

Terrence Brannon

unread,
Oct 21, 2018, 1:22:32 AM10/21/18
to Reahl discuss
Actually it's when you construct the instance, on line 74 that you can do it:

Iwan Vosloo

unread,
Oct 21, 2018, 2:16:46 AM10/21/18
to reahl-...@googlegroups.com
Thats correct.

Fields are part of our "modelinterface" module because they can be used
whether or not you use the web framework.

The reference docs for it is here:
https://www.reahl.org/docs/4.0/component/modelinterface.d.html#field
> <https://gist.github.com/metaperl/63ad1de90cf66c03b3cb39f0a1ba3970#file-defaultvalue-py-L76>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Reahl discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to reahl-discus...@googlegroups.com
> <mailto:reahl-discus...@googlegroups.com>.
> To post to this group, send email to reahl-...@googlegroups.com
> <mailto:reahl-...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/reahl-discuss.
> For more options, visit https://groups.google.com/d/optout.


--

Reahl, the Python only web framework / www.reahl.org
Reply all
Reply to author
Forward
0 new messages