I defined one-to-many relation between two models : Order and
OrderItem.

In OrderItem Controller:

@expose(template='kid:elitesocial.OrderItemController.templates.form')
    def new(self, **kw):
        """Create new records in model"""
        order = Order.get(self.parent)

        order.items.add(newParty)
        return dict(modelname = self.modelname, form = model_form,
page='new')\

class OrderItemFields(widgets.WidgetsList):
    """fields definitions. Replace to your Fields"""
    itemName = widgets.TextField(name='itemName', label='Item
Name')
    parent = widgets.TextField()

Now I'm hoping to build the one-to-many relationship when creation of
OrderItem, but it throws erroe message inside of "new" method., saying
that 'OrderItemController' object has no attribute 'parent'

How can I buid the one-to-many connection when creation of OrderItem?
Please do me a favor, i'm haning here.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to