Exemple #1
0
    def _one_formfield(self, attr, result, must=False):
        attrtype = self._get_attrtype(attr)
        name = attr
        if must:
            name = name + "*"
        if attrtype.uiHint_multiline:
            if attrtype.single_value:
                typed = annotate.Text(label=name,
                                      description=attrtype.desc or '',
                                      required=must)
            else:
                typed = annotate.Text(label=name,
                                      description=attrtype.desc or '',
                                      required=must)
        else:
            if attrtype.single_value:
                typed = annotate.String(label=name,
                                        description=attrtype.desc or '',
                                        required=must)
            else:
                # TODO maybe use a string field+button to add entries,
                # multiselection list+button to remove entries?
                typed = annotate.Text(label=name,
                                      description=attrtype.desc or '',
                                      required=must)

        result.append(annotate.Argument('add_' + attr, typed))
Exemple #2
0
 def bind_submitYourContribution(self, ctx):
     "Bind the proper action to perform when submit action is invoked"
     return [('Author', annotate.String()), ('E-mail', annotate.String()),
             ('Description', annotate.Text()),
             ('Type', annotate.Choice(['Evaluation', 'Template',
                                       'Family'])),
             ('File', annotate.FileUpload(required=False))]
Exemple #3
0
 def doSomething(
         ctx=annotate.Context(),
         fee=annotate.String(required=True, description="Wee!"),
         fi=annotate.Integer(description="Tra-la-la"),
         fo=annotate.Text(),
         fum=annotate.String(),
 ):
     """Do Something Really Exciting
Exemple #4
0
 def bind_animals(self, ctx, ):
     """Add Animal"""
     return annotate.MethodBinding(
             'animals',
             annotate.Method(arguments=
                 [annotate.Argument('animal', annotate.String()),
                  annotate.Argument('description', annotate.Text())]),
             action="Add Animal",
                                   )
 def insert(
     ctx = annotate.Context(),
     title = annotate.String(strip=True, required=True, \
                             requiredFailMessage="Title must be provided", tabindex='1'),
     author = annotate.String(strip=True, default="Anonymous", tabindex='2'),
     id = annotate.String(hidden=True),
     category = annotate.Choice(categories, tabindex='3'),
     content = annotate.Text(required=True, \
                             requiredFailMessage="Posts with no content are not allowed", tabindex='4'),
     ):
     pass
Exemple #6
0
 def updateWiki(self,
                ctx=annotate.Context(),
                text=annotate.Text(),
                new=annotate.String(hidden=True)):
     pass
Exemple #7
0
 def editPasting(request=annotate.Request(),
                 postedBy=annotate.String(immutable=1),
                 author=annotate.String(strip=True),
                 text=annotate.Text(strip=True, required=True)):
     pass
Exemple #8
0
 def addPasting(request=annotate.Request(),
                author=annotate.String(strip=True),
                text=annotate.Text(strip=True, required=True)):
     pass