reviewboard.diffviewer.models.raw_file_diff_data¶
RawFileDiffData model definition.
-
class
RawFileDiffData(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelStores raw diff data as binary content in the database.
This is the class used in Review Board 2.5+ to store diff content. Unlike in previous versions, the content is not base64-encoded. Instead, it is stored either as bzip2-compressed data (if the resulting compressed data is smaller than the raw data), or as the raw data itself.
-
binary_hash[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
binary[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
compression[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
extra_data[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
content[source]¶ Return the content of the diff.
The content will be uncompressed (if necessary) and returned as the raw set of bytes originally uploaded.
-
recalculate_line_counts(tool)[source]¶ Recalculates the insert_count and delete_count values.
This will attempt to re-parse the stored diff and fetch the line counts through the parser.
-
filediffs[source]¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
id[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
parent_filediffs[source]¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-