Makes sense. I actually ended up using your example and it worked well as far as I can tell. And you actually explained the importing too, which is where I messed up previously.
Also, I made the mistake of putting it in a file that was already importing a bunch of other things, so I got wrapped up in import hell, but I think I found a better place to keep that class. Thanks! On Feb 9, 2:13 pm, Doug Ballance <dball...@gmail.com> wrote: > > Doug, I don't see how the LazyFetch you wrote is much different than > > what akaariai shared? Can you explain to me what the difference is? > > And I'm not saying that in a condescending way, I'm saying I'm just > > not sharp enough on my Python to recognize the difference. > > Slightly different implementation of the same idea. From your reply > to his post I thought there was still some confusion on the concept so > I did a modification of a class we use in a project so that you could > have a tested/working sample. They are fundamentally the same > approach to the problem, it just seemed to me that treating an > instance of the class as the 'page' variable rather than 'cache' used > to fetch a url might be clearer as an example. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.