[TASK] Removed a method that would cause twice the work.
This commit is contained in:
1 parent
65b5d4fcc8
commit
2270dd23a8
3 files changed
+7
-15
No files matched your search
+3
-11
@@ -5,7 +5,7 @@ from Django import PersonIdentityManager
|
||||
|
||||
|
||||
class PersonMapper():
|
||||
|
||||
""" This little guy will help you get through your day and map citavi persons against identities. """
|
||||
def __init__(self):
|
||||
""" Initializes ProjectManager and PersonIdentityManager. """
|
||||
self._citavi_project_manager = ProjectManager()
|
||||
@@ -43,15 +43,6 @@ class PersonMapper():
|
||||
mapped_uuid_dict[person.citavi_uuid] = person
|
||||
return mapped_uuid_dict
|
||||
|
||||
def get_mapped_identities_with_representation(self, project):
|
||||
""" Returns a uuid->person dict for all mapped persons within a project in a tuple containing a unicode representation. """
|
||||
mapped_persons = self._person_identity_manager.get_mapped_identities_for_project(project)
|
||||
mapped_uuid_dict = {}
|
||||
for person in mapped_persons:
|
||||
person_representation = self.get_representation_for_citavi_identity(person)
|
||||
mapped_uuid_dict[person.citavi_uuid] = (person, person_representation)
|
||||
return mapped_uuid_dict
|
||||
|
||||
def create_new_identity(self, project, person):
|
||||
""" Creates a new identity for a given person. """
|
||||
return self._person_identity_manager.create_identity(project, person.ID)
|
||||
@@ -79,4 +70,5 @@ class PersonMapper():
|
||||
return unicode(citavi_person.ID) + u" " + unicode(citavi_person.FirstName) + u" " + unicode(citavi_person.LastName)
|
||||
|
||||
|
||||
person_mapper = PersonMapper()
|
||||
# Create a PersonMapper instance for public use, so ressources are not wasted.
|
||||
person_mapper = PersonMapper()
|
||||
Reference in new issue
Block a user