Good practice: Function Field naming ?

10 views
Skip to first unread message

Maxime Richez

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

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

unread,
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
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
Reply all
Reply to author
Forward
0 new messages