2012-08-26 03:48:43 +00:00
|
|
|
import datetime
|
2011-03-19 05:15:02 +00:00
|
|
|
from django.db import models
|
|
|
|
|
2012-07-23 14:44:09 +00:00
|
|
|
|
2012-07-30 12:19:17 +00:00
|
|
|
class UuidObjidMap(models.Model):
|
2012-07-23 14:44:09 +00:00
|
|
|
"""
|
|
|
|
Model used for store crocdoc uuid and file object id mapping.
|
|
|
|
"""
|
|
|
|
uuid = models.CharField(max_length=40)
|
|
|
|
obj_id = models.CharField(max_length=40, unique=True)
|
|
|
|
|
2012-08-26 03:48:43 +00:00
|
|
|
class FileComment(models.Model):
|
|
|
|
"""
|
|
|
|
Model used for leave comment on file.
|
|
|
|
NOTE:
|
|
|
|
Need manually create index for (file_path_hash, repo_id).
|
|
|
|
"""
|
|
|
|
repo_id = models.CharField(max_length=36, db_index=True)
|
|
|
|
file_path = models.TextField()
|
|
|
|
file_path_hash = models.CharField(max_length=12)
|
|
|
|
from_email = models.EmailField()
|
|
|
|
message = models.TextField()
|
|
|
|
timestamp = models.DateTimeField(default=datetime.datetime.now)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
ordering = ['-timestamp']
|