
from clusto.drivers.base import Driver

class Location(Driver):

    _clusto_type = "location"
    _driver_name = "location"



@@ -120,9 +120,699 @@
 ation%22%0A%0A
+    def insert(self, thing):%0A        %22%22%22Insert the given Enity or Driver into this Entity.%0A%0A        Such that:%0A%0A        %3E%3E%3E A.insert(B)%0A        %3E%3E%3E (B in A)%0A        True%0A%0A        A given entity can only be in one Location one time.%0A        %22%22%22%0A%0A        d = self.ensure_driver(thing,%0A                               %22Can only insert an Entity or a Driver. %22%0A                               %22Tried to insert %25s.%22 %25 str(type(thing)))%0A%0A        locations = thing.parents(clusto_drivers=%5Bself._driver_name%5D)%0A        if locations:%0A            raise TypeError(%22%25s is already in location(s) %25s.%22 %25%0A                                (thing, locations))%0A%0A        self.add_attr(%22_contains%22, d, number=True)
 %0A

add Location.insert() instead of using inherited Driver.insert()