Sunday, January 16, 2011

compiled methods

Hello,

is there such a thing as "compiled methods" in Django i.e. methods
whose return value is calculated only once and then stored? Or is
there a canonical Djangoish way to implement this?

An example:

Suppose we have phone objects that have a canonical form, such as
"alcatel a-341 i" and a paraphrase type p and a method variants() that
calculates all variants of the canonical form, given the paraphrase
type p, such as:

alcatel a-341 i, alcatel a 341 i, alcatel a341 i, alcatel a-341-i,
alcatel a 341-i, alcatel a341-i, alcatel a-341i, alcatel a 341i,
alcatel a341i, a-341 i, a 341 i, a341 i, a-341-i, a 341-i, a341-i,
a-341i, a 341i, a341i

Obviously it is very bad for speed to calculate the variants of each
phone object every time the object is needed for some action.

Santiago


--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate