Can django lazy-load fields in a model?
Posted
by Leopd
on Stack Overflow
See other posts from Stack Overflow
or by Leopd
Published on 2010-06-16T23:31:20Z
Indexed on
2010/06/16
23:52 UTC
Read the original article
Hit count: 268
One of my django models has a large TextField
which I often don't need to use. Is there a way to tell django to "lazy-load" this field? i.e. not to bother pulling it from the database unless I explicitly ask for it. I'm wasting a lot of memory and bandwidth pulling this TextField
into python every time I refer to these objects.
The alternative would be to create a new table for the contents of this field, but I'd rather avoid that complexity if I can.
© Stack Overflow or respective owner