Good practice: Function Field naming ?

Skip to first unread message

Maxime Richez

Apr 26, 2018, 9:26:57 AM4/26/18
to tryton-dev

I'm adding function fields from model purchase in model purchase_line : party, currency, purchase_date,...

Wondering if it's better to name those fields with a prefix : purchase_party, purchase_currency,... but purchase_date is already prefixed...

Should i define a global dictionary of mapped fields or use a startwith function to remove prefix ?

Or finally don't care to prefix except for duplicate name fields ?

Thanks for suggestions!

Cédric Krier

Apr 26, 2018, 9:55:06 AM4/26/18
to tryton-dev
For me, the rule should be to use a name that describes the best field
and is unambiguous from the Model point of view.
So in your case, you should use a prefix only if the name of the field
without it has an ambiguous meaning or if there could be another module
that adds the same field but for different purpose.

Cédric Krier - B2CK SPRL
Tel: +32 472 54 46 59
Reply all
Reply to author
0 new messages