We also need to add a save() method to the booksomeplace.domain.property.PropertyService class. This method needs to accept a Property instance as an argument, retrieved from cleaned form data using the getPropertyFromForms() form service method described earlier in this section. As our PropertyService class is already geared toward working with entity classes, the code is absurdly simple, as you can see here:
def save(self, prop) :
prop.generatePropertyKey()
return self.collection.insert_one(prop)
Next, we will learn to add a new property.