Commits

Max Noel committed b14f8dd

* Using type(self).__table__ instead of self.__table__ to fix a metaclassy use case where __table__ was made a class property. Will do the same to __hash_key__, __range_key__ and __schema__ if it keeps being a problem.

  • Participants
  • Parent commits 3c895a1

Comments (0)

Files changed (1)

File dynamodb_mapper/model.py

         update an existing one (iff allow_overwrite == True -- otherwise,
         the operation fails with OverwriteError).
         """
-        table = ConnectionBorg().get_table(self.__table__)
+        table = ConnectionBorg().get_table(type(self).__table__)
         item_data = self.to_db_dict()
         item = Item(table, attrs=item_data)
 
         else:
             range_key_value = None
 
-        table = ConnectionBorg().get_table(self.__table__)
+        table = ConnectionBorg().get_table(type(self).__table__)
         Item(table, hash_key_value, range_key_value).delete()