The booksomeplace.entity.booking module and its main class, Booking, is the most complicated of all. The reason is that a booking brings together subclasses from both Customer and Property. The class definition is located in a file called /chapters/07/src/booksomeplace/entity/booking.py. We start by defining a subclass called PropBooking to bring together property-related subclasses. In addition, we add propertyName for quick reference and propertyKey for future reference:
# booksomeplace.entity.booking
import os,sys
sys.path.append(os.path.realpath("../../../src"))
from booksomeplace.entity.base import Base, Name, Location, Contact
from booksomeplace.entity.user import OtherInfo
class PropBooking(Base) :
fields = {
'propertyKey' : '',
'propertyName' : '',
'propertyAddr' : Location(),
'propertyContact' : Contact()
}
Next, we define a subclass...