2010-12-02 15:09:53 +00:00
|
|
|
from django.db import models
|
|
|
|
from django.contrib.auth.models import User
|
2010-12-09 05:06:17 +00:00
|
|
|
from codereview.dashboard.models import Repository
|
2010-12-02 15:09:53 +00:00
|
|
|
|
|
|
|
class Review(models.Model):
|
|
|
|
author = models.ForeignKey(User)
|
|
|
|
created = models.DateTimeField(auto_now_add=True)
|
2010-12-09 05:06:17 +00:00
|
|
|
description = models.TextField()
|
2010-12-02 15:09:53 +00:00
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
return 'Review #{0}'.format(self.pk)
|
|
|
|
class Item(models.Model):
|
|
|
|
review = models.ForeignKey(Review)
|
2010-12-09 05:06:17 +00:00
|
|
|
repo = models.ForeignKey(Repository)
|
2010-12-02 15:09:53 +00:00
|
|
|
ref = models.CharField(max_length=40)
|
|
|
|
path = models.TextField()
|
|
|
|
class Comment(models.Model):
|
|
|
|
item = models.ForeignKey(Item)
|
|
|
|
author = models.ForeignKey(User)
|
|
|
|
created = models.DateTimeField(auto_now_add=True)
|
|
|
|
blob = models.IntegerField()
|
|
|
|
offset = models.IntegerField()
|
|
|
|
text = models.TextField()
|