Skip to content

Instantly share code, notes, and snippets.

@fxdgear
Created July 19, 2012 20:26
Show Gist options
  • Save fxdgear/3146540 to your computer and use it in GitHub Desktop.
Save fxdgear/3146540 to your computer and use it in GitHub Desktop.
Template Choices
Something along these lines:
class SiteTemplate
name - Business user "friendly" name
path - The path to the actual template
type - ('style', 'boutique')
class SiteTemplateContext
"""
We use this to restrict template availability to only
the contexts we want.
"""
template - SiteTemplate
context - SiteContext
On SiteContext, we add:
default_boutique_template - SiteTemplate
default_style_template - SiteTemplate
This lets us define the defaults at the SiteContext level, so conceivably the defaults for Toys R Us and Rue proper can be different.
On BoutiqueContext, we can add:
boutique_template - SiteTemplate: this can be blank, in which case we use the default_boutique_template from SiteContext.
default_style_template - SiteTemplate: this can also be blank, and we fall back to default_style_template from SiteContext.
StyleContext:
style_template - SiteTemplate: nullable, falls back to above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment