bradley.ayers
bradley.ayers

Reputation: 38392

Django class naming convention regarding abbreviations

Is there an existing naming convention for using abbreviations in Django classes (e.g. models, forms, etc)? Specifically I'm interested if there's different rules between abbreviations/acronyms/initialisms?

So far I've only found examples of non-acronyms:

What should a JSON field be called (since it's an acronym)?

Upvotes: 2

Views: 608

Answers (1)

dokkaebi
dokkaebi

Reputation: 9190

From PEP 8:

Use JSONField over JsonField.

Since CapWords are used for class names, this comment applies:

Note: When using abbreviations in CapWords, capitalize all the letters of the abbreviation. Thus HTTPServerError is better than HttpServerError.

Upvotes: 7

Related Questions