示例#1
0
 def responses(self):
     yield [
         mapping.Column(self.name),
         mapping.Column(self.tag),
         mapping.Column(self.position),
         mapping.List(mapping.Definition('content'), key='children')
     ]
示例#2
0
 def responses(self):
     base: List[Any] = [
         mapping.Column(self.tag),
         mapping.Column(self.created_on),
         mapping.Column(self.published_on)
     ]
     yield base
     yield 'complete', base + [
         mapping.List(mapping.Definition('article', 'toc'), key='articles')
     ]
示例#3
0
 def responses(self):
     base = self.get_mixin('historized').response(self)
     yield [mapping.Column(self.key)]
     yield "from_page", [
         mapping.Column(self.key),
         mapping.Field(types.db.String,
                       name='languages',
                       function=lambda a: dict(
                           ((p.language.name, p.name) for p in a.pages)))
     ]
     yield "complete", [
         mapping.Column(self.key),
         mapping.List(mapping.Definition('page'), key='pages')
     ] + base
示例#4
0
 def responses(self):
     base = self.get_mixin('historized').response(self)
     yield [
         mapping.Column(self.name)
     ]
     yield "list", [
         mapping.Column(self.name),
         mapping.Field(types.db.String, name='language', function=lambda x: x.language.name),
         mapping.Field(types.db.Integer, name='article', function=lambda x: x.article.key)
     ]
     yield 'complete', [
         mapping.Column(self.name),
         mapping.Field(types.db.Integer, name='version_count', function=lambda page: len(page.versions)),
         mapping.Definition('version', key='last_version'),
         mapping.Definition('article', 'from_page', key='article')
     ] + base
示例#5
0
 def responses(self):
     base: Any = [
         mapping.Column(self.name),
         mapping.Column(self.position),
         mapping.Column(self.lang)
     ]
     yield base
     with_anchors = base + [
         mapping.List(mapping.Definition('content'),
                      function=self._get_top_anchors,
                      name='anchors')
     ]
     yield 'toc', with_anchors
     yield 'complete', with_anchors + [
         mapping.Column(self.markdown),
         mapping.Column(self.html)
     ]
示例#6
0
 def payloads(self):
     yield 'new', [
         mapping.Column(self.name, required=True),
         mapping.Field(types.db.String, key='content')
     ]
示例#7
0
 def responses(self):
     base = self.get_mixin('historized').response(self)
     yield [mapping.Column(self.content)] + base
示例#8
0
 def responses(self):
     yield [mapping.Column(self.name), mapping.Column(self.default)]
示例#9
0
 def payloads(self):
     yield [mapping.Column(self.name, required=True)]