def dnd(self): self._dnd = True if not self.id: self.id = 'grid-%d' % random.randrange(0, 9999) return self