Entry 3041

formalchemy grid

   

Submitted by anonymous on Jan. 20, 2010 at 10:32 p.m.
Language: Python. Code size: 777 bytes.

from formalchemy.ext.zope import FieldSet, Grid, Pk
 
class IOrderEditForm(interface.Interface):
   """Interface of order's edition form"""
   number = schema.Int(title=u"Id of the order", required=True)   
   supplyer = schema.List(title=u"Supplyer", required=True)

class IOrderAddItemForm(interface.Interface):
   line = schema.Int(title=u"Line", required=True)    
   product = schema.List(title=u"Product", required=True)
   quantity = schema.Int(title=u"Quantity", required=True)
OrderAddItemForm  = Grid(IOrderAddItemForm)
OrderEditForm = FieldSet(IOrderEditForm)
 
class OrderEdit(object):
    _pk = Pk("number")
    interface.implements(IOrderEditForm) 
 
class OrderAddItem(object):
    _pk = Pk("line")
    interface.implements(IOrderAddItemForm)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).