Fixed #19501 -- added Model.from_db() method

Implements a new from_db() method for models. The method can be used to customize or speed up model loading.
Does this example do anything different from normal model loading? If so, what? If not, an actual use case example would be really helpful.