Welcome!

This community is for professionals and enthusiasts of our products and services.Share and discuss the best content and new marketing ideas,build your professional profile and become a better marketer together.

Register
1

What is a computed field?

By
Diogo Duarte
on 11/4/15, 9:58 PM396 views

What is a computed field?


0
Diogo Duarte
On11/4/15, 9:58 PM

Fields can have values calculated by a method, instead of simply reading a database stored value. A computed field is declared just like a regular field, but has an additional argument computed with the name of the method used to calculate it like "is_admin = fields.Boolean(compute="_compute_is_admin", store=False)". If you want to store the computed field in the database, you can use "store=True". You can also compute multiple fields at the same time by using the same method on all the computed fields and set the fields like "self.field_1 = value_1", so on and so forth.


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, justuse the commenting tool. Please remember that you can alwaysrevise your answers - no need to answer the same question twice. Also, pleasedon't forget to vote - it really helps to select the best questions and answers!

Keep Informed

About This Community

This community is for professionals and enthusiasts of our products and services.Share and discuss the best content and new marketing ideas,build your professional profile and become a better marketer together.

Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 11/4/15, 9:58 PM
Seen: 396 times
Last updated: 11/5/15, 1:25 AM