Commits

Mike Bayer  committed 2918d98

fix some examples

  • Participants
  • Parent commits 682f9b9

Comments (0)

Files changed (3)

File examples/association/basic_association.py

        for order_item in order.order_items]
 
 # print customers who bought 'MySQL Crowbar' on sale
-q = session.query(Order).join(['order_items', 'item'])
+q = session.query(Order).join('order_items', 'item')
 q = q.filter(and_(Item.description == 'MySQL Crowbar',
                   Item.price > OrderItem.price))
 

File examples/association/proxied_association.py

        for item in order.items]
 
 # print customers who bought 'MySQL Crowbar' on sale
-orders = session.query(Order).join(['itemassociations', 'item']).filter(
+orders = session.query(Order).join('itemassociations', 'item').filter(
     and_(Item.description=='MySQL Crowbar', Item.price > OrderItem.price))
 print [order.customer_name for order in orders]

File examples/custom_attributes/custom_management.py

 
     def fire_append_event(self, item, initiator=None):
         if initiator is not False and item is not None:
-            self.state.get_impl(self.key).fire_append_event(self.state, item,
+            self.state.get_impl(self.key).fire_append_event(self.state, self.state.dict, item,
                                                             initiator)
 
     def fire_remove_event(self, item, initiator=None):
         if initiator is not False and item is not None:
-            self.state.get_impl(self.key).fire_remove_event(self.state, item,
+            self.state.get_impl(self.key).fire_remove_event(self.state, self.state.dict, item,
                                                             initiator)
 
     def fire_pre_remove_event(self, initiator=None):
-        self.state.get_impl(self.key).fire_pre_remove_event(self.state,
+        self.state.get_impl(self.key).fire_pre_remove_event(self.state, self.state.dict, 
                                                             initiator)
 
 class MyCollection(object):