コード例 #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)
コード例 #2
0
ファイル: product.py プロジェクト: PaulWay/zookeepr
 def __before__(self, **kwargs):
     c.product_categories = ProductCategory.find_all()
     c.ceilings = Ceiling.find_all()
コード例 #3
0
 def new(self):
     c.ceilings = Ceiling.find_all()
     return render('/ceiling/new.mako')
コード例 #4
0
 def index(self):
     c.can_edit = True
     c.ceiling_collection = Ceiling.find_all()
     return render('/ceiling/list.mako')
コード例 #5
0
ファイル: product.py プロジェクト: OdyX/zookeepr
 def __before__(self, **kwargs):
     c.product_categories = ProductCategory.find_all()
     c.fulfilment_types = FulfilmentType.find_all()
     c.ceilings = Ceiling.find_all()
コード例 #6
0
 def __before__(self, **kwargs):
     c.product_categories = ProductCategory.find_all()
     c.fulfilment_types = FulfilmentType.find_all()
     c.ceilings = Ceiling.find_all()