def to_json(self, all_fields=False): json_object = dict( _id=self._id, _rev=self._rev, first_name=self.first_name, last_name=self.last_name, email=self.email, gender=self.gender, phone=self.phone, black_listed=self.black_listed, occupation=self.occupation, company=self.get_company(), date_of_birth=Utility.format_datetime(self.date_of_birth), nationality=self.nationality, state_of_origin=self.state_of_origin, lga_of_origin=self.lga_of_origin, pass_code=self.pass_code, type=self.get_type(), created=Utility.format_datetime(self.created), modified=Utility.format_datetime(self.modified), created_by=Utility.return_instance_id(self.created_by), modified_by=Utility.return_instance_id(self.modified_by) ) if all_fields: json_object.update(dict( image=self.image, fingerprint=self.fingerprint, signature=self.signature, )) return json_object
def to_json(self, all_fields=False): json_object = dict( _id=self._id, _rev=self._rev, visitor=self.visitor.to_json(all_fields), host=self.host.to_json(all_fields), representing=self.representing, purpose=self.purpose, start_date=self.start_date.isoformat(), end_date=self.end_date.isoformat(), start_time=self.start_time.isoformat(), end_time=self.end_time.isoformat(), escort_required=self.escort_required, is_approved=self.is_approved, is_expired=self.is_expired, is_removed=self.is_removed, teams=self.get_team_members(), entrance=self.entrance, created=self.created.isoformat(), modified=Utility.format_datetime(self.modified), created_by=Utility.return_instance_id(self.created_by), modified_by=Utility.return_instance_id(self.modified_by) ) if all_fields: json_object.update(dict()) return json_object
def to_json(self, all_fields=False): json_object = dict( _id=self._id, _rev=self._rev, name=self.name, floor=self.floor, description=self.description, created=Utility.format_datetime(self.created), modifeid=Utility.format_datetime(self.modified), created_by=Utility.return_instance_id(self.created_by), modified_by=Utility.return_instance_id(self.modified_by) ) if all_fields: json_object.update(dict()) return json_object