summaryrefslogtreecommitdiff
path: root/entities/person.py
diff options
context:
space:
mode:
Diffstat (limited to 'entities/person.py')
-rw-r--r--entities/person.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/entities/person.py b/entities/person.py
index c6db584..b315aac 100644
--- a/entities/person.py
+++ b/entities/person.py
@@ -1,3 +1,5 @@
+import json
+
from entities.basic_entity import BasicEntity
@@ -57,6 +59,8 @@ class Person(BasicEntity):
self.comments_list = comments_list
self.profession = profession
+ CSV_FIELDS = ["name", "biodata", "comments"]
+ TYPE = 'PERSON'
def print_entity(self):
print("Name = " + self.name)
@@ -66,3 +70,7 @@ class Person(BasicEntity):
print("Bio Data = " + str(self.bio_data))
print("Comments = " + str(self.comments_list))
print("Profession = " + str(self.profession))
+
+ def to_csv_dict(self):
+ return {'name': self.name, 'biodata': self.bio_data,
+ 'comments': json.dumps(self.comments_list, ensure_ascii=False)}