Changeset 326:46fe057f2605 for pdw/model/frbr.py
- Timestamp:
- 03/10/10 12:32:00 (6 months ago)
- Branch:
- default
- Files:
-
- 1 modified
-
pdw/model/frbr.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pdw/model/frbr.py
r325 r326 302 302 out_obj.items = items 303 303 return out_obj 304 304 305 def to_dict(self): 306 ''' 307 create a dict equivalent to the dict the api is receiving 308 ''' 305 309 out_dict = {} 306 310 table = orm.class_mapper(self.__class__).mapped_table … … 310 314 out_dict[col.name] = val 311 315 # TODO: check type ... 316 persons = [] 312 317 if self.persons: 313 persons = []314 318 for person in self.persons: 319 #TO DO: change this for a consult to the person table, to get 320 #the attrs the person has 315 321 oneperson = {'name': person.name, 316 322 'birth_date': person.birth_date, 317 323 'death_date': person.death_date, 318 'type': person. type,319 'country': person.country,}324 'type': person.entity_type, 325 } 320 326 persons.append(oneperson) 321 327 out_dict['persons'] = persons 322 323 324 328 return out_dict 325 326 327 329 328 330
