Ejemplo n.º 1
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (PrivacyBase.serialize(self), CitationBase.serialize(self),
             NoteBase.serialize(self), RefBase.serialize(self),
             self.frel.serialize(), self.mrel.serialize())
Ejemplo n.º 2
0
    def serialize(self):
        """
        Convert the data held in the Place to a Python tuple that
        represents all the data elements. 
        
        This method is used to convert the object into a form that can easily 
        be saved to a database.

        These elements may be primitive Python types (string, integers),
        complex Python types (lists or tuples, or Python objects. If the
        target database cannot handle complex types (such as objects or
        lists), the database is responsible for converting the data into
        a form that it can use.

        :returns: Returns a python tuple containing the data that should
            be considered persistent.
        :rtype: tuple
        """

        if self.main_loc is None or self.main_loc.serialize() == _EMPTY_LOC:
            main_loc = None
        else:
            main_loc = self.main_loc.serialize()

        return (self.handle, self.gramps_id, self.title, self.long, self.lat,
                main_loc, [al.serialize()
                           for al in self.alt_loc], UrlBase.serialize(self),
                MediaBase.serialize(self), CitationBase.serialize(self),
                NoteBase.serialize(self), self.change, self.private)
Ejemplo n.º 3
0
    def serialize(self):
        """
        Convert the data held in the event to a Python tuple that
        represents all the data elements. 
        
        This method is used to convert the object into a form that can easily 
        be saved to a database.

        These elements may be primitive Python types (string, integers),
        complex Python types (lists or tuples, or Python objects. If the
        target database cannot handle complex types (such as objects or
        lists), the database is responsible for converting the data into
        a form that it can use.

        :returns: Returns a python tuple containing the data that should
            be considered persistent.
        :rtype: tuple
        """
        return (self.handle, self.gramps_id, self.father_handle,
                self.mother_handle,
                [cr.serialize()
                 for cr in self.child_ref_list], self.type.serialize(),
                [er.serialize()
                 for er in self.event_ref_list], MediaBase.serialize(self),
                AttributeBase.serialize(self), LdsOrdBase.serialize(self),
                CitationBase.serialize(self), NoteBase.serialize(self),
                self.change, TagBase.serialize(self), self.private)
Ejemplo n.º 4
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (PrivacyBase.serialize(self), NoteBase.serialize(self),
             AttributeBase.serialize(self), RefBase.serialize(self),
             self.__role.serialize())
Ejemplo n.º 5
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (PrivacyBase.serialize(self), CitationBase.serialize(self),
             NoteBase.serialize(self), DateBase.serialize(self),
             LocationBase.serialize(self))
Ejemplo n.º 6
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (PrivacyBase.serialize(self),
             CitationBase.serialize(self),
             NoteBase.serialize(self),
             self.type.serialize(), self.value)
Ejemplo n.º 7
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (self.handle, self.gramps_id, self.type.serialize(),
             unicode(self.name), NoteBase.serialize(self),
             AddressBase.serialize(self), UrlBase.serialize(self),
             self.change, self.private)
Ejemplo n.º 8
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (CitationBase.serialize(self),
             NoteBase.serialize(self),
             DateBase.serialize(self),
             self.type, self.place,
             self.famc, self.temple, self.status, self.private)
Ejemplo n.º 9
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (self.handle, self.gramps_id, unicode(self.title),
             unicode(self.author), unicode(self.pubinfo),
             NoteBase.serialize(self), MediaBase.serialize(self),
             unicode(self.abbrev), self.change, self.datamap,
             [rr.serialize() for rr in self.reporef_list], self.private)
Ejemplo n.º 10
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (PrivacyBase.serialize(self), CitationBase.serialize(self),
             NoteBase.serialize(self), DateBase.serialize(self),
             self.first_name, SurnameBase.serialize(self), self.suffix,
             self.title, self.type.serialize(), self.group_as, self.sort_as,
             self.display_as, self.call, self.nick, self.famnick)
Ejemplo n.º 11
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (
         NoteBase.serialize(self),
         RefBase.serialize(self),
         self.call_number,
         self.media_type.serialize(),
         PrivacyBase.serialize(self),
     )
Ejemplo n.º 12
0
 def serialize(self, no_text_date=False):
     """
     Convert the object to a serialized tuple of data.
     """
     return (
         self.handle,  #  0
         self.gramps_id,  #  1
         DateBase.serialize(self, no_text_date),  #  2
         unicode(self.page),  #  3
         self.confidence,  #  4
         self.source_handle,  #  5
         NoteBase.serialize(self),  #  6
         MediaBase.serialize(self),  #  7
         self.datamap,  #  8
         self.change,  #  9
         self.private)  # 10
Ejemplo n.º 13
0
    def serialize(self, no_text_date=False):
        """
        Convert the data held in the event to a Python tuple that
        represents all the data elements. 
        
        This method is used to convert the object into a form that can easily 
        be saved to a database.

        These elements may be primitive Python types (string, integers),
        complex Python types (lists or tuples, or Python objects. If the
        target database cannot handle complex types (such as objects or
        lists), the database is responsible for converting the data into
        a form that it can use.

        :returns: Returns a python tuple containing the data that should
            be considered persistent.
        :rtype: tuple
        """
        return (self.handle, self.gramps_id, self.__type.serialize(),
                DateBase.serialize(self, no_text_date), self.__description,
                self.place, CitationBase.serialize(self),
                NoteBase.serialize(self), MediaBase.serialize(self),
                AttributeBase.serialize(self), self.change, self.private)