Monday, February 28, 2011

Django snippets: "Partial Templates" - an alternative to "include"

Django snippets: "Partial Templates" - an alternative to "include": "This snippet adds simple partial support to your templates. You can pass data to the partial, and use it as you would in a regular template. It is different from Django's {% include %}, because it allows you to pass a custom variable (context), instead of reusing the same context for the included template. This decouples the templates from each other and allows for their greater reuse."