Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

coding-style.rst 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  1. ============
  2. Coding Style
  3. ============
  4. General
  5. -------
  6. * PEP8 everywhere while remaining sensible
  7. URLs
  8. ----
  9. * List pages should use plurals; e.g. ``/products/``, ``/notifications/``
  10. * Detail pages should simply be a PK/slug on top of the list page; e.g.
  11. ``/products/the-bible/``, ``/notifications/1/``
  12. * Create pages should have 'create' as the final path segment; e.g.
  13. ``/dashboard/notifications/create/``
  14. * Update pages are sometimes the same as detail pages (i.e., when in the
  15. dashboard). In those cases, just use the detail convention, eg
  16. ``/dashboard/notifications/3/``. If there is a distinction between the detail
  17. page and the update page, use ``/dashboard/notifications/3/update/``.
  18. * Delete pages; e.g., ``/dashboard/notifications/3/delete/``
  19. View class names
  20. ----------------
  21. Classes should be named according to::
  22. '%s%sView' % (class_name, verb)
  23. For example, ``ProductUpdateView``, ``OfferCreateView`` and
  24. ``PromotionDeleteView``. This doesn't fit all situations, but it's a good basis.