1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

change last_modified to BigInteger

This commit is contained in:
lins05
2012-09-25 17:56:26 +08:00
parent 384e59e037
commit 882c33a4dd
2 changed files with 2 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ class FileContributors(models.Model):
file_path = models.TextField() file_path = models.TextField()
file_path_hash = models.CharField(max_length=12) file_path_hash = models.CharField(max_length=12)
last_modified = models.IntegerField() last_modified = models.BigIntegerField()
# email addresses seperated by comma # email addresses seperated by comma
emails = models.TextField() emails = models.TextField()

View File

@@ -81,7 +81,7 @@ def translate_commit_desc(value):
def translate_commit_time(value): def translate_commit_time(value):
"""Translate commit time to human frindly format instead of timestamp""" """Translate commit time to human frindly format instead of timestamp"""
if type(value) == type(1): # check whether value is int if isinstance(value, int) or isinstance(value, long): # check whether value is int
val = datetime.fromtimestamp(value) val = datetime.fromtimestamp(value)
elif isinstance(value, datetime): elif isinstance(value, datetime):
val = datetime.fromtimestamp(int(value.strftime("%s"))) val = datetime.fromtimestamp(int(value.strftime("%s")))