def __create_index(self, name, query, directory): # Note: I am intentionally not checking to make sure # the directory exists. It is up to the indexer to put # the result in the appropriate place. sngindex = SnuggleIndex() sngindex.name = name sngindex.query = query sngindex.directory = directory sngindex.save() return sngindex