コード例 #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.culture)
            if locale:
                locale.update(locale_in)
                locale.document_id = self.document_id
            else:
                self.locales.append(locale_in)

        if other.geometry:
            if self.geometry:
                self.geometry.update(other.geometry)
            else:
                self.geometry = other.geometry
            self.geometry.document_id = self.document_id
コード例 #2
0
ファイル: document.py プロジェクト: tsauerwein/c2corgv6_api
    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.culture)
            if locale:
                locale.update(locale_in)
                locale.document_id = self.document_id
            else:
                self.locales.append(locale_in)

        if other.geometry:
            if self.geometry:
                self.geometry.update(other.geometry)
            else:
                self.geometry = other.geometry
            self.geometry.document_id = self.document_id
コード例 #3
0
ファイル: route.py プロジェクト: mfournier/v6_api
    def to_archive(self):
        locale = ArchiveRouteLocale()
        super(RouteLocale, self).to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
コード例 #4
0
ファイル: route.py プロジェクト: tsauerwein/c2corgv6_api
 def update(self, other):
     super(RouteLocale, self).update(other)
     copy_attributes(other, self, RouteLocale._ATTRIBUTES)
コード例 #5
0
ファイル: route.py プロジェクト: tsauerwein/c2corgv6_api
    def to_archive(self):
        route = ArchiveRoute()
        super(Route, self)._to_archive(route)
        copy_attributes(self, route, Route._ATTRIBUTES)

        return route
コード例 #6
0
ファイル: route.py プロジェクト: tsauerwein/c2corgv6_api
    def to_archive(self):
        locale = ArchiveRouteLocale()
        super(RouteLocale, self).to_archive(locale)
        copy_attributes(self, locale, RouteLocale._ATTRIBUTES)

        return locale
コード例 #7
0
ファイル: waypoint.py プロジェクト: tsauerwein/c2corgv6_api
 def update(self, other):
     super(WaypointLocale, self).update(other)
     copy_attributes(other, self, WaypointLocale._ATTRIBUTES)
コード例 #8
0
ファイル: waypoint.py プロジェクト: tsauerwein/c2corgv6_api
    def to_archive(self):
        waypoint = ArchiveWaypoint()
        super(Waypoint, self)._to_archive(waypoint)
        copy_attributes(self, waypoint, Waypoint._ATTRIBUTES)

        return waypoint
コード例 #9
0
ファイル: image.py プロジェクト: mfournier/v6_api
    def to_archive(self):
        image = ArchiveImage()
        super(Image, self)._to_archive(image)
        copy_attributes(self, image, Image._ATTRIBUTES)

        return image
コード例 #10
0
ファイル: waypoint.py プロジェクト: mfournier/v6_api
    def to_archive(self):
        waypoint = ArchiveWaypoint()
        super(Waypoint, self)._to_archive(waypoint)
        copy_attributes(self, waypoint, attributes)

        return waypoint
コード例 #11
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
コード例 #12
0
 def update(self, other):
     copy_attributes(other, self, DocumentGeometry._ATTRIBUTES)
コード例 #13
0
 def to_archive(self):
     geometry = ArchiveDocumentGeometry()
     copy_attributes(self, geometry, DocumentGeometry._ATTRIBUTES)
     return geometry
コード例 #14
0
 def update(self, other):
     copy_attributes(other, self, DocumentLocale._ATTRIBUTES)
コード例 #15
0
 def to_archive(self, locale):
     copy_attributes(self, locale, DocumentLocale._ATTRIBUTES)
     return locale
コード例 #16
0
ファイル: waypoint.py プロジェクト: tsauerwein/c2corgv6_api
 def update(self, other):
     super(WaypointLocale, self).update(other)
     copy_attributes(other, self, WaypointLocale._ATTRIBUTES)
コード例 #17
0
ファイル: document.py プロジェクト: tsauerwein/c2corgv6_api
 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
コード例 #18
0
ファイル: waypoint.py プロジェクト: mfournier/v6_api
 def update(self, other):
     super(Waypoint, self).update(other)
     copy_attributes(other, self, attributes)
コード例 #19
0
ファイル: image.py プロジェクト: mfournier/v6_api
 def update(self, other):
     super(Image, self).update(other)
     copy_attributes(other, self, Image._ATTRIBUTES)
コード例 #20
0
ファイル: image.py プロジェクト: tsauerwein/c2corgv6_api
    def to_archive(self):
        image = ArchiveImage()
        super(Image, self)._to_archive(image)
        copy_attributes(self, image, Image._ATTRIBUTES)

        return image
コード例 #21
0
ファイル: waypoint.py プロジェクト: tsauerwein/c2corgv6_api
    def to_archive(self):
        locale = ArchiveWaypointLocale()
        super(WaypointLocale, self).to_archive(locale)
        copy_attributes(self, locale, WaypointLocale._ATTRIBUTES)

        return locale
コード例 #22
0
ファイル: image.py プロジェクト: tsauerwein/c2corgv6_api
 def update(self, other):
     super(Image, self).update(other)
     copy_attributes(other, self, Image._ATTRIBUTES)
コード例 #23
0
ファイル: route.py プロジェクト: tsauerwein/c2corgv6_api
    def to_archive(self):
        route = ArchiveRoute()
        super(Route, self)._to_archive(route)
        copy_attributes(self, route, Route._ATTRIBUTES)

        return route
コード例 #24
0
ファイル: document.py プロジェクト: tsauerwein/c2corgv6_api
 def to_archive(self, locale):
     copy_attributes(self, locale, DocumentLocale._ATTRIBUTES)
     return locale
コード例 #25
0
ファイル: route.py プロジェクト: tsauerwein/c2corgv6_api
 def update(self, other):
     super(RouteLocale, self).update(other)
     copy_attributes(other, self, RouteLocale._ATTRIBUTES)
コード例 #26
0
ファイル: document.py プロジェクト: tsauerwein/c2corgv6_api
 def update(self, other):
     copy_attributes(other, self, DocumentLocale._ATTRIBUTES)
コード例 #27
0
ファイル: route.py プロジェクト: tsauerwein/c2corgv6_api
    def to_archive(self):
        locale = ArchiveRouteLocale()
        super(RouteLocale, self).to_archive(locale)
        copy_attributes(self, locale, RouteLocale._ATTRIBUTES)

        return locale
コード例 #28
0
ファイル: document.py プロジェクト: tsauerwein/c2corgv6_api
 def to_archive(self):
     geometry = ArchiveDocumentGeometry()
     copy_attributes(self, geometry, DocumentGeometry._ATTRIBUTES)
     return geometry
コード例 #29
0
ファイル: route.py プロジェクト: mfournier/v6_api
    def to_archive(self):
        route = ArchiveRoute()
        super(Route, self)._to_archive(route)
        copy_attributes(self, route, attributes)

        return route
コード例 #30
0
ファイル: document.py プロジェクト: tsauerwein/c2corgv6_api
 def update(self, other):
     copy_attributes(other, self, DocumentGeometry._ATTRIBUTES)
コード例 #31
0
ファイル: route.py プロジェクト: mfournier/v6_api
 def update(self, other):
     super(RouteLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
コード例 #32
0
ファイル: waypoint.py プロジェクト: tsauerwein/c2corgv6_api
    def to_archive(self):
        locale = ArchiveWaypointLocale()
        super(WaypointLocale, self).to_archive(locale)
        copy_attributes(self, locale, WaypointLocale._ATTRIBUTES)

        return locale