def __init__( self, contact_name: str, contact_email: str, address: Address, company_name: str = None, website: (str, ) = None, # - Arguments from HMSMongoDataObject oid: (UUID, str, None) = None, created: (datetime, str, float, int, None) = None, modified: (datetime, str, float, int, None) = None, is_active: (bool, int, None) = None, is_deleted: (bool, int, None) = None, is_dirty: (bool, int, None) = None, is_new: (bool, int, None) = None, *products): """ Object initialization. self .............. (Artisan instance, required) The instance to execute against contact_name ...... (str, required) The name of the primary contact for the Artisan that the instance represents contact_email ..... (str [email address], required) The email address of the primary contact for the Artisan that the instance represents address ........... (Address, required) The mailing/shipping address for the Artisan that the instance represents company_name ...... (str, optional, defaults to None) The company- name for the Artisan that the instance represents oid ............... (UUID|str, optional, defaults to None) The unique identifier of the object's state-data record in the back-end data-store created ........... (datetime|str|float|int, optional, defaults to None) The date/time that the object was created modified .......... (datetime|str|float|int, optional, defaults to None) The date/time that the object was last modified is_active ......... (bool|int, optional, defaults to None) A flag indicating that the object is active is_deleted ........ (bool|int, optional, defaults to None) A flag indicating that the object should be considered deleted (and may be in the near future) is_dirty .......... (bool|int, optional, defaults to None) A flag indicating that the object's data needs to be updated in the back-end data-store is_new ............ (bool|int, optional, defaults to None) A flag indicating that the object's data needs to be created in the back-end data-store products .......... (BaseProduct collection) The products associated with the Artisan that the instance represents """ # - Call parent initializers if needed BaseArtisan.__init__(self, contact_name, contact_email, address, company_name, website) HMSMongoDataObject.__init__(self, oid, created, modified, is_active, is_deleted, is_dirty, is_new) if products: BaseArtisan._set_products(*products)
def __init__( self, # - Required arguments from BaseArtisan contact_name: str, contact_email: str, address: Address, # - Optional arguments from BaseArtisan company_name: str = None, website: (str, ) = None, # - Optional arguments from BaseDataObject/JSONFileDataObject oid: (UUID, str, None) = None, created: (datetime, str, float, int, None) = None, modified: (datetime, str, float, int, None) = None, is_active: (bool, int, None) = None, is_deleted: (bool, int, None) = None, is_dirty: (bool, int, None) = None, is_new: (bool, int, None) = None, # - the products arglist from BaseArtisan *products): """ Object initialization. self .............. (Artisan instance, required) The instance to execute against contact_name ...... (str, required) The name of the primary contact for the Artisan that the instance represents contact_email ..... (str [email address], required) The email address of the primary contact for the Artisan that the instance represents address ........... (Address, required) The mailing/shipping address for the Artisan that the instance represents company_name ...... (str, optional, defaults to None) The company- name for the Artisan that the instance represents website ........... (str, optional, defaults to None) The the URL of the website associated with the Artisan that the instance represents oid ............... (UUID|str, optional, defaults to None) created ........... (datetime|str|float|int, optional, defaults to None) modified .......... (datetime|str|float|int, optional, defaults to None) is_active ......... (bool|int, optional, defaults to None) is_deleted ........ (bool|int, optional, defaults to None) is_dirty .......... (bool|int, optional, defaults to None) is_new ............ (bool|int, optional, defaults to None) products .......... (BaseProduct collection) The products associated with the Artisan that the instance represents """ # - Call parent initializers if needed BaseArtisan.__init__(self, contact_name, contact_email, address, company_name, website, *products) JSONFileDataObject.__init__(self, oid, created, modified, is_active, is_deleted, is_dirty, is_new) # - Set default instance property-values using _del_... methods # - Set instance property-values from arguments using # _set_... methods # - Perform any other initialization needed self._set_is_dirty(False)
def _set_address(self, value: Address) -> None: # - Call the parent method result = BaseArtisan._set_address(self, value) self._set_is_dirty(True) return result
def _del_website(self) -> None: # - Call the parent method result = BaseArtisan._del_website(self) self._set_is_dirty(True) return result
def _del_contact_email(self) -> None: # - Call the parent method result = BaseArtisan._del_contact_email(self) self._set_is_dirty(True) return result
def _set_website(self, value: (str, None)) -> None: # - Call the parent method result = BaseArtisan._set_website(self, value) self._set_is_dirty(True) return result
def _set_contact_name(self, value: str) -> None: # - Call the parent method result = BaseArtisan._set_contact_name(self, value) self._set_is_dirty(True) return result