Exemplo n.º 1
0
    def update(self, other):
        """Copies the attributes from `other` to this document.
        Also updates all locales.
        """
        copy_attributes(other, self, Document._ATTRIBUTES_WHITELISTED)

        for locale_in in other.locales:
            locale = self.get_locale(locale_in.lang)
            if locale:
                locale.update(locale_in)
                locale.document_id = self.document_id
            else:
                self.locales.append(locale_in)

        if other.geometry:
            if self.geometry:
                if not self.geometry.almost_equals(other.geometry):
                    self.geometry.update(other.geometry)
            else:
                self.geometry = other.geometry
            self.geometry.document_id = self.document_id
Exemplo n.º 2
0
    def update(self, other):
        """Copies the attributes from `other` to this document.
        Also updates all locales.
        """
        copy_attributes(other, self, Document._ATTRIBUTES_WHITELISTED)

        for locale_in in other.locales:
            locale = self.get_locale(locale_in.lang)
            if locale:
                locale.update(locale_in)
                locale.document_id = self.document_id
            else:
                self.locales.append(locale_in)

        if other.geometry:
            if self.geometry:
                if not self.geometry.almost_equals(other.geometry):
                    self.geometry.update(other.geometry)
            else:
                self.geometry = other.geometry
            self.geometry.document_id = self.document_id
Exemplo n.º 3
0
    def to_archive(self):
        waypoint = ArchiveWaypoint()
        super(Waypoint, self)._to_archive(waypoint)
        copy_attributes(self, waypoint, attributes)

        return waypoint
Exemplo n.º 4
0
 def update(self, other):
     super(WaypointLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
Exemplo n.º 5
0
 def _to_archive(self, doc):
     """Copy the attributes of this document into a passed in
     `Archive*` instance.
     """
     copy_attributes(self, doc, Document._ATTRIBUTES)
     return doc
Exemplo n.º 6
0
    def to_archive(self):
        locale = ArchiveOutingLocale()
        super(OutingLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
Exemplo n.º 7
0
    def to_archive(self):
        user_profile = ArchiveUserProfile()
        super(UserProfile, self)._to_archive(user_profile)
        copy_attributes(self, user_profile, attributes)

        return user_profile
Exemplo n.º 8
0
    def to_archive(self):
        book = ArchiveBook()
        super(Book, self)._to_archive(book)
        copy_attributes(self, book, attributes)

        return book
Exemplo n.º 9
0
 def update(self, other):
     super(XreportLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
Exemplo n.º 10
0
    def to_archive(self):
        locale = ArchiveWaypointLocale()
        super(WaypointLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
Exemplo n.º 11
0
 def update(self, other):
     super(UserProfile, self).update(other)
     copy_attributes(other, self, attributes)
Exemplo n.º 12
0
    def to_archive(self):
        m = ArchiveTopoMap()
        super(TopoMap, self)._to_archive(m)
        copy_attributes(self, m, attributes)

        return m
Exemplo n.º 13
0
    def to_archive(self):
        user_profile = ArchiveUserProfile()
        super(UserProfile, self)._to_archive(user_profile)
        copy_attributes(self, user_profile, attributes)

        return user_profile
Exemplo n.º 14
0
 def update(self, other):
     super(XreportLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
Exemplo n.º 15
0
    def to_archive(self):
        locale = ArchiveXreportLocale()
        super(XreportLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
Exemplo n.º 16
0
 def to_archive(self):
     xreport = ArchiveXreport()
     super(Xreport, self)._to_archive(xreport)
     copy_attributes(self, xreport, attributes)
     return xreport
Exemplo n.º 17
0
 def update(self, other):
     super(Book, self).update(other)
     copy_attributes(other, self, attributes)
Exemplo n.º 18
0
 def to_archive(self):
     xreport = ArchiveXreport()
     super(Xreport, self)._to_archive(xreport)
     copy_attributes(self, xreport, attributes)
     return xreport
Exemplo n.º 19
0
 def _to_archive(self, locale):
     copy_attributes(self, locale, DocumentLocale._ATTRIBUTES)
     return locale
Exemplo n.º 20
0
    def to_archive(self):
        image = ArchiveImage()
        super(Image, self)._to_archive(image)
        copy_attributes(self, image, attributes)

        return image
Exemplo n.º 21
0
 def update(self, other):
     copy_attributes(other, self, DocumentLocale._ATTRIBUTES)
Exemplo n.º 22
0
    def to_archive(self):
        article = ArchiveArticle()
        super(Article, self)._to_archive(article)
        copy_attributes(self, article, attributes)

        return article
Exemplo n.º 23
0
 def to_archive(self):
     geometry = ArchiveDocumentGeometry()
     copy_attributes(self, geometry, DocumentGeometry._ATTRIBUTES)
     return geometry
Exemplo n.º 24
0
    def to_archive(self):
        image = ArchiveImage()
        super(Image, self)._to_archive(image)
        copy_attributes(self, image, attributes)

        return image
Exemplo n.º 25
0
 def update(self, other):
     copy_attributes(other, self, DocumentGeometry._ATTRIBUTES)
Exemplo n.º 26
0
 def update(self, other):
     copy_attributes(other, self, DocumentGeometry._ATTRIBUTES)
Exemplo n.º 27
0
 def _to_archive(self, doc):
     """Copy the attributes of this document into a passed in
     `Archive*` instance.
     """
     copy_attributes(self, doc, Document._ATTRIBUTES)
     return doc
Exemplo n.º 28
0
    def to_archive(self):
        outing = ArchiveOuting()
        super(Outing, self)._to_archive(outing)
        copy_attributes(self, outing, attributes)

        return outing
Exemplo n.º 29
0
    def to_archive(self):
        route = ArchiveRoute()
        super(Route, self)._to_archive(route)
        copy_attributes(self, route, attributes)

        return route
Exemplo n.º 30
0
 def update(self, other):
     super(OutingLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
Exemplo n.º 31
0
    def to_archive(self):
        m = ArchiveTopoMap()
        super(TopoMap, self)._to_archive(m)
        copy_attributes(self, m, attributes)

        return m
Exemplo n.º 32
0
    def to_archive(self):
        locale = ArchiveWaypointLocale()
        super(WaypointLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
Exemplo n.º 33
0
 def update(self, other):
     super(TopoMap, self).update(other)
     copy_attributes(other, self, attributes)
Exemplo n.º 34
0
    def to_archive(self):
        area = ArchiveArea()
        super(Area, self)._to_archive(area)
        copy_attributes(self, area, attributes)

        return area
Exemplo n.º 35
0
    def to_archive(self):
        article = ArchiveArticle()
        super(Article, self)._to_archive(article)
        copy_attributes(self, article, attributes)

        return article
Exemplo n.º 36
0
 def update(self, other):
     super(TopoMap, self).update(other)
     copy_attributes(other, self, attributes)
Exemplo n.º 37
0
    def to_archive(self):
        area = ArchiveArea()
        super(Area, self)._to_archive(area)
        copy_attributes(self, area, attributes)

        return area
Exemplo n.º 38
0
    def to_archive(self):
        locale = ArchiveXreportLocale()
        super(XreportLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
Exemplo n.º 39
0
    def to_archive(self):
        locale = ArchiveOutingLocale()
        super(OutingLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
Exemplo n.º 40
0
    def to_archive(self):
        book = ArchiveBook()
        super(Book, self)._to_archive(book)
        copy_attributes(self, book, attributes)

        return book
Exemplo n.º 41
0
 def update(self, other):
     super(OutingLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
Exemplo n.º 42
0
    def to_archive(self):
        waypoint = ArchiveWaypoint()
        super(Waypoint, self)._to_archive(waypoint)
        copy_attributes(self, waypoint, attributes)

        return waypoint
Exemplo n.º 43
0
    def to_archive(self):
        outing = ArchiveOuting()
        super(Outing, self)._to_archive(outing)
        copy_attributes(self, outing, attributes)

        return outing
Exemplo n.º 44
0
 def update(self, other):
     super(WaypointLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
Exemplo n.º 45
0
 def _to_archive(self, locale):
     copy_attributes(self, locale, DocumentLocale._ATTRIBUTES)
     return locale
Exemplo n.º 46
0
 def update(self, other):
     super(Article, self).update(other)
     copy_attributes(other, self, attributes)
Exemplo n.º 47
0
 def update(self, other):
     copy_attributes(other, self, DocumentLocale._ATTRIBUTES)
Exemplo n.º 48
0
 def update(self, other):
     super(UserProfile, self).update(other)
     copy_attributes(other, self, attributes)
Exemplo n.º 49
0
 def to_archive(self):
     geometry = ArchiveDocumentGeometry()
     copy_attributes(self, geometry, DocumentGeometry._ATTRIBUTES)
     return geometry
Exemplo n.º 50
0
 def update(self, other):
     super(Image, self).update(other)
     copy_attributes(other, self, attributes)
Exemplo n.º 51
0
    def to_archive(self):
        route = ArchiveRoute()
        super(Route, self)._to_archive(route)
        copy_attributes(self, route, attributes)

        return route