wiki:DeveloperGuidelines/CodeConventions

Version 14 (modified by Fran Boon, 14 years ago) ( diff )

--

DeveloperGuidelines

Code Conventions

These conventions should be followed in all code.

NOTE: These coding conventions are mandatory for code to be accepted for the Stable series!

Code Style

Naming conventions

  • All functions outside of classes should have the prefix shn_<Model Name>_
  • All classes which over-ride existing classed should have the suffix "S3"

Comments and Docstrings

  • All files, classes and functions should have docstrings which allow to auto-generate API documentation using epydoc

Internationalisation

  • All user-visible strings should be Internationalised: T("My string")
    • Remember to str() them before concatenating with strings (such as HTML tags): "<p>" + str(T("My String")) + "</p>"
  • All labels should be Internationalised in controllers/module.py def resource(): table.field.label = T("My Label")
  • DeveloperGuidelinesInternationalisation

Tools


DeveloperGuidelines

Note: See TracWiki for help on using the wiki.