# HG changeset patch # User Todd Larsen # Date 1211485742 0 # Node ID 14c266e01a56412ee817d08b3c7925c261954e6d # Parent 616855b101b5deb0f3fd557c76bf24b4c6142cbd Fix a typo in the {% extends %} example and add a section on Model-specific View template sub-directories. diff -r 616855b101b5 -r 14c266e01a56 soc/templates/README.templates --- a/soc/templates/README.templates Thu May 22 19:37:38 2008 +0000 +++ b/soc/templates/README.templates Thu May 22 19:49:02 2008 +0000 @@ -1,10 +1,12 @@ +TEMPLATE NAMESPACES + Templates are placed in a "namespace" subdirectory in the templates directory, since the templates directory will be added to the Django templates search path. This allows other packages to extend existing templates without "hiding" the original template. For example, a template in another Melange application can extend a template in the SoC framework like this: - {% extends 'soc/some_existing_template.html %} + {% extends 'soc/some_existing_template.html' %} without "hiding" the some_existing_template.html for other uses, even if the derived template is also named some_existing_template.html. @@ -16,3 +18,11 @@ sharing of templates between applications as well. For exmample, the GSoC Melange application should place its templates in gsoc/templates/gsoc. +MODEL/VIEW TEMPLATE NAMING + +View templates are usually named some_view.html for a corresponding someView() +function and SomeViewForm form class. Since SomeView is likely to be a common +View name for multiple Models, Model-specific templates should be placed in +soc/ sub-directories. For example, the template used by the Profile +view for the Person Model belongs in soc/person/profile.html. +