Exemplo n.º 1
0
    def edit(self, id):
        c.ceilings = Ceiling.find_all()
        c.ceiling = Ceiling.find_by_id(id)

        defaults = h.object_to_defaults(c.ceiling, 'ceiling')

        if c.ceiling.parent:
            defaults['ceiling.parent'] = c.ceiling.parent.id

        defaults['ceiling.products'] = []
        for product in c.ceiling.products:
            defaults['ceiling.products'].append(product.id)
        if c.ceiling.available_from:
            defaults['ceiling.available_from'] = c.ceiling.available_from.strftime('%d/%m/%y')
        if c.ceiling.available_until:
            defaults['ceiling.available_until'] = c.ceiling.available_until.strftime('%d/%m/%y')

        form = render('/ceiling/edit.mako')
        return htmlfill.render(form, defaults)
Exemplo n.º 2
0
 def __before__(self, **kwargs):
     c.product_categories = ProductCategory.find_all()
     c.ceilings = Ceiling.find_all()
Exemplo n.º 3
0
 def new(self):
     c.ceilings = Ceiling.find_all()
     return render('/ceiling/new.mako')
Exemplo n.º 4
0
 def index(self):
     c.can_edit = True
     c.ceiling_collection = Ceiling.find_all()
     return render('/ceiling/list.mako')
Exemplo n.º 5
0
 def __before__(self, **kwargs):
     c.product_categories = ProductCategory.find_all()
     c.fulfilment_types = FulfilmentType.find_all()
     c.ceilings = Ceiling.find_all()
Exemplo n.º 6
0
 def __before__(self, **kwargs):
     c.product_categories = ProductCategory.find_all()
     c.fulfilment_types = FulfilmentType.find_all()
     c.ceilings = Ceiling.find_all()