Exemplo n.º 1
0
 def edit(self):
     buttons = [tag_for('input', Type='submit', Class='button', name=name_for(caption + ' button'), id=name_for(caption + ' button'), value=caption) for caption in self.captions]
     if hasattr(self,'cancel'):
         buttons.append(tag_for('a', 'cancel', href=getattr(self,'cancel','cancel')))
     return layout_field(' ',' '.join(buttons))
Exemplo n.º 2
0
 def __getattr__(self,name):
     if name == 'name' and hasattr(self,'label'):
         return name_for(self.label)
     raise AttributeError