示例#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
示例#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
示例#3
0
    def to_archive(self):
        waypoint = ArchiveWaypoint()
        super(Waypoint, self)._to_archive(waypoint)
        copy_attributes(self, waypoint, attributes)

        return waypoint
示例#4
0
 def update(self, other):
     super(WaypointLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
示例#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
示例#6
0
文件: outing.py 项目: c2corg/v6_api
    def to_archive(self):
        locale = ArchiveOutingLocale()
        super(OutingLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
示例#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
示例#8
0
    def to_archive(self):
        book = ArchiveBook()
        super(Book, self)._to_archive(book)
        copy_attributes(self, book, attributes)

        return book
示例#9
0
文件: xreport.py 项目: c2corg/v6_api
 def update(self, other):
     super(XreportLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
示例#10
0
    def to_archive(self):
        locale = ArchiveWaypointLocale()
        super(WaypointLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

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

        return m
示例#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
示例#14
0
文件: xreport.py 项目: millerf/v6_api
 def update(self, other):
     super(XreportLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
示例#15
0
文件: xreport.py 项目: millerf/v6_api
    def to_archive(self):
        locale = ArchiveXreportLocale()
        super(XreportLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
示例#16
0
文件: xreport.py 项目: millerf/v6_api
 def to_archive(self):
     xreport = ArchiveXreport()
     super(Xreport, self)._to_archive(xreport)
     copy_attributes(self, xreport, attributes)
     return xreport
示例#17
0
 def update(self, other):
     super(Book, self).update(other)
     copy_attributes(other, self, attributes)
示例#18
0
文件: xreport.py 项目: c2corg/v6_api
 def to_archive(self):
     xreport = ArchiveXreport()
     super(Xreport, self)._to_archive(xreport)
     copy_attributes(self, xreport, attributes)
     return xreport
示例#19
0
 def _to_archive(self, locale):
     copy_attributes(self, locale, DocumentLocale._ATTRIBUTES)
     return locale
示例#20
0
文件: image.py 项目: sriks123/v6_api
    def to_archive(self):
        image = ArchiveImage()
        super(Image, self)._to_archive(image)
        copy_attributes(self, image, attributes)

        return image
示例#21
0
 def update(self, other):
     copy_attributes(other, self, DocumentLocale._ATTRIBUTES)
示例#22
0
文件: article.py 项目: c2corg/v6_api
    def to_archive(self):
        article = ArchiveArticle()
        super(Article, self)._to_archive(article)
        copy_attributes(self, article, attributes)

        return article
示例#23
0
 def to_archive(self):
     geometry = ArchiveDocumentGeometry()
     copy_attributes(self, geometry, DocumentGeometry._ATTRIBUTES)
     return geometry
示例#24
0
文件: image.py 项目: c2corg/v6_api
    def to_archive(self):
        image = ArchiveImage()
        super(Image, self)._to_archive(image)
        copy_attributes(self, image, attributes)

        return image
示例#25
0
 def update(self, other):
     copy_attributes(other, self, DocumentGeometry._ATTRIBUTES)
示例#26
0
 def update(self, other):
     copy_attributes(other, self, DocumentGeometry._ATTRIBUTES)
示例#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
示例#28
0
文件: outing.py 项目: c2corg/v6_api
    def to_archive(self):
        outing = ArchiveOuting()
        super(Outing, self)._to_archive(outing)
        copy_attributes(self, outing, attributes)

        return outing
示例#29
0
    def to_archive(self):
        route = ArchiveRoute()
        super(Route, self)._to_archive(route)
        copy_attributes(self, route, attributes)

        return route
示例#30
0
文件: outing.py 项目: c2corg/v6_api
 def update(self, other):
     super(OutingLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
示例#31
0
文件: topo_map.py 项目: c2corg/v6_api
    def to_archive(self):
        m = ArchiveTopoMap()
        super(TopoMap, self)._to_archive(m)
        copy_attributes(self, m, attributes)

        return m
示例#32
0
    def to_archive(self):
        locale = ArchiveWaypointLocale()
        super(WaypointLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
示例#33
0
文件: topo_map.py 项目: c2corg/v6_api
 def update(self, other):
     super(TopoMap, self).update(other)
     copy_attributes(other, self, attributes)
示例#34
0
    def to_archive(self):
        area = ArchiveArea()
        super(Area, self)._to_archive(area)
        copy_attributes(self, area, attributes)

        return area
示例#35
0
文件: article.py 项目: c2corg/v6_api
    def to_archive(self):
        article = ArchiveArticle()
        super(Article, self)._to_archive(article)
        copy_attributes(self, article, attributes)

        return article
示例#36
0
 def update(self, other):
     super(TopoMap, self).update(other)
     copy_attributes(other, self, attributes)
示例#37
0
文件: area.py 项目: c2corg/v6_api
    def to_archive(self):
        area = ArchiveArea()
        super(Area, self)._to_archive(area)
        copy_attributes(self, area, attributes)

        return area
示例#38
0
文件: xreport.py 项目: c2corg/v6_api
    def to_archive(self):
        locale = ArchiveXreportLocale()
        super(XreportLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
示例#39
0
    def to_archive(self):
        locale = ArchiveOutingLocale()
        super(OutingLocale, self)._to_archive(locale)
        copy_attributes(self, locale, attributes_locales)

        return locale
示例#40
0
文件: book.py 项目: c2corg/v6_api
    def to_archive(self):
        book = ArchiveBook()
        super(Book, self)._to_archive(book)
        copy_attributes(self, book, attributes)

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

        return waypoint
示例#43
0
    def to_archive(self):
        outing = ArchiveOuting()
        super(Outing, self)._to_archive(outing)
        copy_attributes(self, outing, attributes)

        return outing
示例#44
0
 def update(self, other):
     super(WaypointLocale, self).update(other)
     copy_attributes(other, self, attributes_locales)
示例#45
0
 def _to_archive(self, locale):
     copy_attributes(self, locale, DocumentLocale._ATTRIBUTES)
     return locale
示例#46
0
文件: article.py 项目: c2corg/v6_api
 def update(self, other):
     super(Article, self).update(other)
     copy_attributes(other, self, attributes)
示例#47
0
 def update(self, other):
     copy_attributes(other, self, DocumentLocale._ATTRIBUTES)
示例#48
0
 def update(self, other):
     super(UserProfile, self).update(other)
     copy_attributes(other, self, attributes)
示例#49
0
 def to_archive(self):
     geometry = ArchiveDocumentGeometry()
     copy_attributes(self, geometry, DocumentGeometry._ATTRIBUTES)
     return geometry
示例#50
0
文件: image.py 项目: c2corg/v6_api
 def update(self, other):
     super(Image, self).update(other)
     copy_attributes(other, self, attributes)
示例#51
0
文件: route.py 项目: c2corg/v6_api
    def to_archive(self):
        route = ArchiveRoute()
        super(Route, self)._to_archive(route)
        copy_attributes(self, route, attributes)

        return route