def get(self, key=None, view=None):
self.set_header("<STR_LIT>", "<STR_LIT:*>")<EOL>self.set_header("<STR_LIT:Content-Type>", "<STR_LIT:application/json>")<EOL>if key is not None:<EOL><INDENT>value = {}<EOL>value.update(self.database[key])<EOL>if view is not None:<EOL><INDENT>context = {}<EOL>context["<STR_LIT:value>"] = value<EOL>context["<STR_LIT>"] = self.ctx<EOL>result = json.dumps(getattr(views, view)(context))<EOL><DEDENT>else:<EOL><INDENT>result = json.dumps(value)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>result = json.dumps(self.database.values())<EOL><DEDENT>self.write(result)<EOL>
Register a new model (models)