diff options
author | roy lewin <roy.lewin@gmail.com> | 2016-09-21 21:59:22 +0300 |
---|---|---|
committer | roy lewin <roy.lewin@gmail.com> | 2016-09-21 21:59:22 +0300 |
commit | 985a0fcac8b89bfe3c5bdcea0889b921cc27c033 (patch) | |
tree | 8cc9bc1fbcae35a0aab8b49e3f04c3c0843e0fdd /entities | |
parent | 9876529cd25312ce1b92329618a81d962fb86c44 (diff) |
Added basic entities
Diffstat (limited to 'entities')
-rw-r--r-- | entities/__init__.py | 3 | ||||
-rw-r--r-- | entities/basic_entity.py | 5 | ||||
-rw-r--r-- | entities/institution.py | 6 | ||||
-rw-r--r-- | entities/location.py | 8 | ||||
-rw-r--r-- | entities/person.py | 18 |
5 files changed, 40 insertions, 0 deletions
diff --git a/entities/__init__.py b/entities/__init__.py index e69de29..48f64d6 100644 --- a/entities/__init__.py +++ b/entities/__init__.py @@ -0,0 +1,3 @@ +from person import Person +from institution import Institution +from location import Location
\ No newline at end of file diff --git a/entities/basic_entity.py b/entities/basic_entity.py new file mode 100644 index 0000000..9181422 --- /dev/null +++ b/entities/basic_entity.py @@ -0,0 +1,5 @@ +from libs import JsonSerializable + + +class BasicEntity(JsonSerializable): + pass diff --git a/entities/institution.py b/entities/institution.py new file mode 100644 index 0000000..4538207 --- /dev/null +++ b/entities/institution.py @@ -0,0 +1,6 @@ +from entities.basic_entity import BasicEntity + + +class Institution(BasicEntity): + def __init__(self): + raise NotImplementedError() diff --git a/entities/location.py b/entities/location.py new file mode 100644 index 0000000..8130632 --- /dev/null +++ b/entities/location.py @@ -0,0 +1,8 @@ +from entities.basic_entity import BasicEntity + + +class Location(BasicEntity): + def __init__(self, name, types, coordinates): + self.name = name + self.types = types + self.coordinates = coordinates diff --git a/entities/person.py b/entities/person.py new file mode 100644 index 0000000..b9e9d78 --- /dev/null +++ b/entities/person.py @@ -0,0 +1,18 @@ +from entities.basic_entity import BasicEntity + + +class Person(BasicEntity): + def __init__(self, name, date_of_birth, name_in_langs): + """ + + :param name: + :param date_of_birth: + :param name_in_langs: Mapping of the persons's name in various languages, as a dictionary. For example: + { + "latin": "George" + "heb": "[george in hebrew]" + } + """ + self.name = name + self.date_of_birth = date_of_birth + self.name_in_langs = name_in_langs |