I have been looking into Django since February and not done much with
it in recent months. But the past few days for some reason everything
just clicked and I have cranked out a ton of cool functionality rather
painlessly. I'm loving Django so far! I have just completed my first
real world django project. Thanks Django team!

My project has room for improvement: I just have realized that one of
the attributes on one of my models depends on other outside factors
for its value such that it becomes outdated after being set. I have
very nearly a million instances of this object in the database. So I
can't just update all million of them when something changes.

It should be possible to somehow wrap accesses to this attribute,
recalculate, and return the correct updated value. But I understand
that property() won't work with model attributes and even if they did
I would have to rename the attribute in the model which would not make
the ORM happy.

Also, I notice that the only place I really access this attribute is:

queryset.filter(Status='Good', received__range=(hourago, now)).order_by('Score')

Plus, I'm not sure how the ORM and Python count this as an access to
"Score" (the value I want to recalc/update on the fly) due to the way
it is apparently passed to the ORM as a string.

Suggestions? Thanks!

-- 
Tracy Reed
http://tracyreed.org

Attachment: pgp8BYTf6ogbc.pgp
Description: PGP signature

Reply via email to