Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Cookbook

Byron Ruth edited this page May 7, 2013 · 1 revision

Context & View Templates

DataContext and DataView both come with a template and default field. These can be used in downstream client implementations for enabling default context and/or view data for user agents. For example, Serrano checks if there is a default template defined for the resource if this is the requesting user's first time accessing it.

cxt = DataContext({...}, template=True, default=True)
cxt.save()

Many templates can be created for each type, but only one default can exist for each. Upon save, this will be checked to prevent ambiguity for downstream clients.

Clone this wiki locally