+ timestamp = models.DateTimeField(auto_now_add=True)
+
+ # document to merge
+ document = models.CharField(max_length=255)
+
+ # revision to be merged into the main branch
+ source_revision = models.CharField(max_length=40, unique=True)
+ target_revision = models.CharField(max_length=40, required=False)
+
+ # current status
+ status = models.CharField(max_length=1, choices=REQUEST_STATUSES.items())
+
+ # comment to the status change of request (if applicable)
+ response_comment = models.TextField(blank=True)
+
+ # revision number in which the changes were merged (if any)
+ merged_revision = models.CharField(max_length=40, blank=True, null=True)
+ merge_timestamp = models.DateTimeField(blank=True, null=True)
+
+ def __unicode__(self):
+ return unicode(self.comitter) + u':' + self.document
+
+
+ class Meta:
+ permissions = (
+ ("view_prq", "Can view pull request's contents."),
+ )
+
+
+# This is actually an abstract Model, but if we declare
+# it as so Django ignores the permissions :(
+class Document(models.Model):
+ class Meta:
+ permissions = (
+ ("share_document", "Can share documents without pull requests."),
+ ("view_other_document", "Can view other's documents."),
+ )
\ No newline at end of file