djdb/models.py
def fetch_and_merge(cls, obj):
        """Walk over an object's tag edit history and compute the
        current state of its tags.

        Args:
          obj: The object in question.  If obj has an 'import_tags'
            property, they are used to seed the set of tags.
        """
        current_tags = set(getattr(obj, "import_tags", []))
        edit_query = cls.all()
        edit_query.filter("subject =", obj)
        edit_query.order("timestamp")
        # TODO(trow): We should angrily complain if the number of tag
        # edits is too high.
        for edit in AutoRetry(edit_query).fetch(999):
            current_tags.difference_update(edit.removed)
            current_tags.update(edit.added)
        obj.current_tags = list(current_tags)
        obj.save()
        return current_tags
Walk over an object's tag edit history and compute the
        current state of its tags.

        Args:
          obj: The object in question.  If obj has an 'import_tags'
            property, they are used to seed the set of tags.
        
Walk over an object's tag edit history and compute the
current state of its tags.
Walk over an object ' s tag edit history and compute the current state of its tags .
def fetch_and_merge(cls, obj):
        current_tags = set(getattr(obj, "import_tags", []))
        edit_query = cls.all()
        edit_query.filter("subject =", obj)
        edit_query.order("timestamp")
        for edit in AutoRetry(edit_query).fetch(999):
            current_tags.difference_update(edit.removed)
            current_tags.update(edit.added)
        obj.current_tags = list(current_tags)
        obj.save()
        return current_tags
def fetch_and_merge ( cls , obj ) : current_tags = set ( getattr ( obj , "import_tags" , [ ] ) ) edit_query = cls . all ( ) edit_query . filter ( "subject =" , obj ) edit_query . order ( "timestamp" ) for edit in AutoRetry ( edit_query ) . fetch ( 999 ) : current_tags . difference_update ( edit . removed ) current_tags . update ( edit . added ) obj . current_tags = list ( current_tags ) obj . save ( ) return current_tags
Walk over an object's tag edit history and compute the
current state of its tags.
Walk over an object ' s tag edit history and compute the current state of its tags .
"""Walk over an object's tag edit history and compute the
        current state of its tags.

        Args:
          obj: The object in question.  If obj has an 'import_tags'
            property, they are used to seed the set of tags.
        """ # TODO(trow): We should angrily complain if the number of tag # edits is too high.
cls
obj
The object in question.  If obj has an 'import_tags'
property, they are used to seed the set of tags.
The object in question . If obj has an ' import_tags ' property they are used to seed the set of tags .