def __getitem__(self, key): ti = cms.get_type('cms-type:%s'%key) if ti is not None: return Model(ti, self, self.request) raise KeyError(key)
def render(self): subpath = self.request.subpath if subpath and subpath[0]: tname = subpath[0] tinfo = cms.get_type('cms-type:%s'%tname) if tinfo is None: raise HTTPNotFound form = AddContentForm(tinfo, self, self.request) form.update() return form.render() return super(Adding, self).render()