def home(view=None): """Redirect to application home. """ if view: return redirect_to(url_for_page(view)) return redirect_to(url_for_page())
class Person(CollectionModel): pass key = property(lambda self: zoom.utils.id_for(self.name)) url = property(lambda self: url_for_page('people', self.key)) # link = property(lambda self: self.name) link = property(lambda self: zoom.helpers.link_to(self.name, self.url))
def menu_item(name): return (name, url_for_page('fields', name.lower()))
hint='test hint'), MultiselectField('Multiselect', options=['One', 'Two', 'Three'], hint='test hint'), ChosenMultiselectField('Sizes', options=['One', 'Two', 'Three', 'Four'], hint='test hint', placeholder='Choose as you wish'), RangeSliderField('Price', min=0, max=1500), ButtonField('Okay!', hint='test hint'), ButtonsField(['One', 'Two'], cancel='cancel', hint='test hint'), MemoField('Memo', hint='test hint'), MarkdownField('Markdown', hint='test hint'), EditField('Editor', hint='test hint'), ImageField('Photo'), ButtonField('Save', cancel=url_for_page('fields'))) sample = dict( name='Joey', email='*****@*****.**', postal_code='V8X 2P2', phone='2341231234', twitter='dsilabs', web='https://www.dsilabs.ca', password='******', number_of_things=123, count=456, size=1.2345, decimal=Decimal('1234132.234'), amount=Decimal('12341232.32432'), foreign_amount=Decimal('121232.432'),