Adrian Holovaty wrote:
Seems like its not possible to access request object in hooks like
pre_save and display methods(those are listed in list_display) ? Is it
supposed to be like this by design ? If so then hardly its very
convinient to use in real applications.
Yes, this is by design. Models have no knowledge of whether they're
being used in a Web context, or in a shell script, or in a desktop GUI
app. Coupling models to Web requests would be convenient in some cases
but a bad design decision overall.
I see. As for save hooks i agree, but display methods anyway used only
in Web context(as for now?) and seems accessing request object from
there shouldn't make too much harm to models design ?
plisk