<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -134,6 +134,8 @@ class Item(object):
         Note that items you are linking to must already exist and must have been
         saved before this item is saved or they will be ignored.&quot;&quot;&quot;
 
+        if weight &lt; 0 or weight &gt; 10:
+            raise Exception('Weights must be in the range of zero to 10')
         if isinstance(other, Item):
             other = other.name
         self.__set_link(type, other, weight)</diff>
      <filename>Python/directed_edge.py</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,8 @@ class QueryTest(unittest.TestCase):
         self.customer.link_to(customer3, 10)
         self.assert_(&quot;customer3&quot; in self.customer.links())
         self.assert_(self.customer.weight_for(&quot;customer3&quot;) == 10)
+        self.assertRaises(Exception, self.customer.link_to, self.product, -1)
+        self.assertRaises(Exception, self.customer.link_to, self.product, 11)
 
     def testTags(self):
         self.assert_(len(self.customer.tags) == 1)</diff>
      <filename>Python/directed_edge_test.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0af1114921997a05d023f48e4b75c053bcd3afce</id>
    </parent>
  </parents>
  <author>
    <name>Scott Wheeler</name>
    <email>scott@directededge.com</email>
  </author>
  <url>http://github.com/directededge/directed-edge-bindings/commit/38cc1172dafb79538a16abe9ce0e017d9ca758aa</url>
  <id>38cc1172dafb79538a16abe9ce0e017d9ca758aa</id>
  <committed-date>2009-10-17T07:15:55-07:00</committed-date>
  <authored-date>2009-10-17T07:15:55-07:00</authored-date>
  <message>Check in Python too for out of range weights.</message>
  <tree>5396cec163bfbf4b7209022e72b1bc303ecbea65</tree>
  <committer>
    <name>Scott Wheeler</name>
    <email>scott@directededge.com</email>
  </committer>
</commit>
