Beispiel #1
0
 def get_schema(self):
     schema = colander.Schema(title = _(u"Select discussion posts to print"),
                              description = _(u"print_discussion_description",
                                              default = u"Each post will be on its own page"))
     for post in self.context.get_content(content_type = 'DiscussionPost'):
         schema.add(colander.SchemaNode(colander.Bool(),
                                        name = post.__name__,
                                        title = strip_and_truncate(post.text, symbol = '[...]'),))
     return schema
Beispiel #2
0
def add_discussions_owner_nodes(schema, discussion_posts):
    for obj in discussion_posts:
        name = obj.__name__
        title = name
        description = strip_and_truncate(obj.title, limit=150)
        schema.add(colander.SchemaNode(colander.String(),
                                       name = name,
                                       title = title,
                                       description = description,
                                       validator = deferred_existing_userid_validator,
                                       widget = deferred_autocompleting_userid_widget,))
Beispiel #3
0
def add_proposals_owner_nodes(schema, proposals):
    for obj in proposals:
        name = obj.__name__
        title = obj.get_field_value('aid')
        description = strip_and_truncate(obj.title, limit=150)
        schema.add(colander.SchemaNode(colander.String(),
                                       name = name,
                                       title = title,
                                       description = description,
                                       validator = deferred_existing_userid_validator,
                                       widget = deferred_autocompleting_userid_widget,))
Beispiel #4
0
 def title(self):
     return strip_and_truncate(self.text, limit=100, symbol='')
Beispiel #5
0
 def title(self):
     return strip_and_truncate(self.text, limit = 100, symbol = '')