|
|
|
@ -13,51 +13,46 @@ class Person:
|
|
|
|
|
self.deactivated = data.deactivated is not None
|
|
|
|
|
self.has_photo = data.has_photo == 1
|
|
|
|
|
self.followers_count = data.followers_count
|
|
|
|
|
self.sex = data.sex
|
|
|
|
|
self.bdate = data.get_date(data.bdate)
|
|
|
|
|
self.relation = data.relation
|
|
|
|
|
self.country_id = data.get_int(data.country, 'id')
|
|
|
|
|
self.country = data.get_int(data.country, 'title')
|
|
|
|
|
self.city_id = data.get_int(data.city, 'id')
|
|
|
|
|
self.city = data.get_int(data.city, 'title')
|
|
|
|
|
self.home_town = data.home_town
|
|
|
|
|
self.status = data.status
|
|
|
|
|
self.sex = data.get_int('sex')
|
|
|
|
|
self.bdate = RawData.get_date_st(data.bdate)
|
|
|
|
|
self.relation = data.get_int('relation')
|
|
|
|
|
self.country_id = RawData.get_int_st(data.country, 'id')
|
|
|
|
|
self.country = RawData.get_str_st(data.country, 'title')
|
|
|
|
|
self.city_id = RawData.get_int_st(data.city, 'id')
|
|
|
|
|
self.city = RawData.get_str_st(data.city, 'title')
|
|
|
|
|
self.home_town = data.get_str('home_town')
|
|
|
|
|
self.status = data.get_str('status')
|
|
|
|
|
self.site = data.site is not None
|
|
|
|
|
self.facebook = data.facebook is not None
|
|
|
|
|
self.twitter = data.twitter is not None
|
|
|
|
|
self.instagram = data.instagram is not None
|
|
|
|
|
self.mobile_phone = data.mobile_phone is not None
|
|
|
|
|
self.activities = data.activities
|
|
|
|
|
self.interests = data.interests
|
|
|
|
|
self.books = data.books
|
|
|
|
|
self.movies = data.movies
|
|
|
|
|
self.music = data.music
|
|
|
|
|
self.tv = data.tv
|
|
|
|
|
self.games = data.games
|
|
|
|
|
self.quotes = data.quotes
|
|
|
|
|
self.about = data.about
|
|
|
|
|
self.activities = data.get_str('activities')
|
|
|
|
|
self.interests = data.get_str('interests')
|
|
|
|
|
self.books = data.get_str('books')
|
|
|
|
|
self.movies = data.get_str('movies')
|
|
|
|
|
self.music = data.get_str('music')
|
|
|
|
|
self.tv = data.get_str('tv')
|
|
|
|
|
self.games = data.get_str('games')
|
|
|
|
|
self.quotes = data.get_str('quotes')
|
|
|
|
|
self.about = data.get_str('about')
|
|
|
|
|
personal = None
|
|
|
|
|
if data.personal is not None:
|
|
|
|
|
if len(data.personal) == 1:
|
|
|
|
|
personal = data.personal[0]
|
|
|
|
|
if len(data.personal) > 1:
|
|
|
|
|
raise Exception(f'PERSONAL {data.id}')
|
|
|
|
|
self.political = data.get_int(personal, 'political')
|
|
|
|
|
self.religion = data.get_str(personal, 'religion')
|
|
|
|
|
self.inspired_by = data.get_str(personal, 'inspired_by')
|
|
|
|
|
self.people_main = data.get_int(personal, 'people_main')
|
|
|
|
|
self.life_main = data.get_int(personal, 'life_main')
|
|
|
|
|
self.smoking = data.get_int(personal, 'smoking')
|
|
|
|
|
self.alcohol = data.get_int(personal, 'alcohol')
|
|
|
|
|
self.relatives = Person.__collection(data.relatives, lambda item: item['type'])
|
|
|
|
|
self.occupation_type = data.get_str(data.occupation, 'type')
|
|
|
|
|
self.occupation_place_id = data.get_int(data.occupation, 'id')
|
|
|
|
|
self.occupation_place_name = data.get_str(data.occupation, 'name')
|
|
|
|
|
self.universities = Person.__collection(data.universities, lambda item: University(item).__dict__)
|
|
|
|
|
self.schools = Person.__collection(data.schools, lambda item: School(item).__dict__)
|
|
|
|
|
self.career = Person.__collection(data.career, lambda item: Career(item).__dict__)
|
|
|
|
|
self.military = Person.__collection(data.military, lambda item: Military(item).__dict__)
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def __collection(collection, function):
|
|
|
|
|
return list(map(lambda item: function(item), [] if collection is None else collection))
|
|
|
|
|
self.political = RawData.get_int_st(personal, 'political')
|
|
|
|
|
self.religion = RawData.get_str_st(personal, 'religion')
|
|
|
|
|
self.inspired_by = RawData.get_str_st(personal, 'inspired_by')
|
|
|
|
|
self.people_main = RawData.get_int_st(personal, 'people_main')
|
|
|
|
|
self.life_main = RawData.get_int_st(personal, 'life_main')
|
|
|
|
|
self.smoking = RawData.get_int_st(personal, 'smoking')
|
|
|
|
|
self.alcohol = RawData.get_int_st(personal, 'alcohol')
|
|
|
|
|
self.relatives = RawData.get_collection_st(data.relatives, lambda item: item['type'])
|
|
|
|
|
self.occupation_type = RawData.get_str_st(data.occupation, 'type')
|
|
|
|
|
self.occupation_place_name = RawData.get_str_st(data.occupation, 'name')
|
|
|
|
|
self.universities = RawData.get_collection_st(data.universities, lambda item: University(item).__dict__)
|
|
|
|
|
self.schools = RawData.get_collection_st(data.schools, lambda item: School(item).__dict__)
|
|
|
|
|
self.career = RawData.get_collection_st(data.career, lambda item: Career(item).__dict__)
|
|
|
|
|
self.military = RawData.get_collection_st(data.military, lambda item: Military(item).__dict__)
|
|
|
|
|