Open GoogleCodeExporter opened 9 years ago
Yes, why not. :-)
TBH I find Django's tendency to have "optionally a callable" everywhere in its
API a liability. Do you have a use case where it really is a big deal to
manually set a computed initial value? If so, I'd like to know more about it.
Original comment by guido@google.com
on 13 Aug 2012 at 2:01
In my current project I wanted to assign a randomly initialized float (0<= f <=
1) for a "random article" functionality. I had the feeling it was better not to
bother the dev using that model with a comment on how to initialize that random
field and why.
Other examples: default Usernames, random CSRF tokens, API Keys...
I have the feeling if not overused it really can make the code less verbose in
many cases.
Original comment by joernhees2
on 15 Aug 2012 at 9:19
It almost makes me thing we need a post-create hook that is called when a new
entity is created by the app calling the constructor or by get_or_insert(), but
not when it is read from the datastore.
Original comment by guido@google.com
on 15 Aug 2012 at 9:32
Original issue reported on code.google.com by
joernhees2
on 9 Aug 2012 at 5:29