[boto] r1338 committed - Fixed ReverseReferenceProperty item_type to be the type of item that i...

1 view
Skip to first unread message

codesite...@google.com

unread,
Oct 26, 2009, 1:08:17 PM10/26/09
to boto-...@googlegroups.com
Revision: 1338
Author: kopertop
Date: Mon Oct 26 10:07:38 2009
Log: Fixed ReverseReferenceProperty item_type to be the type of item that
it resolves, not the class
that it was being applied to

http://code.google.com/p/boto/source/detail?r=1338

Modified:
/trunk/boto/sdb/db/property.py

=======================================
--- /trunk/boto/sdb/db/property.py Tue Oct 20 12:21:40 2009
+++ /trunk/boto/sdb/db/property.py Mon Oct 26 10:07:38 2009
@@ -364,7 +364,7 @@
if hasattr(self.reference_class, self.collection_name):
raise ValueError, 'duplicate property: %s' %
self.collection_name
setattr(self.reference_class, self.collection_name,
- _ReverseReferenceProperty(model_class, property_name,
self.collection_name, self.reference_class))
+ _ReverseReferenceProperty(model_class, property_name,
self.collection_name))

def check_uuid(self, value):
# This does a bit of hand waving to "type check" the string
@@ -394,11 +394,11 @@
data_type = Query
type_name = 'query'

- def __init__(self, model, prop, name, reference_class):
+ def __init__(self, model, prop, name):
self.__model = model
self.__property = prop
self.name = name
- self.item_type = reference_class
+ self.item_type = model

def __get__(self, model_instance, model_class):
"""Fetches collection of model instances of this collection
property."""

Reply all
Reply to author
Forward
0 new messages