erang backend
This commit is contained in:
parent
ecd40e9b86
commit
61563cef58
|
@ -1,7 +1,7 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
import datetime
|
import datetime
|
||||||
from django.db.models.signals import post_save
|
from django.db.models.signals import post_save
|
||||||
import subprocess
|
# import subprocess
|
||||||
import os
|
import os
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
|
@ -35,9 +35,9 @@ class Document(models.Model):
|
||||||
title = models.CharField(max_length=500)
|
title = models.CharField(max_length=500)
|
||||||
issue = models.ForeignKey(Issue)
|
issue = models.ForeignKey(Issue)
|
||||||
notes = models.TextField(blank=True)
|
notes = models.TextField(blank=True)
|
||||||
contributor = models.ForeignKey(Contributor)
|
contributor = models.ForeignKey(Contributor, blank=True, null=True)
|
||||||
doc_txt = models.TextField(blank=True)
|
doc_txt = models.TextField(blank=True)
|
||||||
date_added = models.DateTimeField(default=datetime.datetime.now())
|
date_added = models.DateTimeField(default=datetime.datetime.now(), editable=False)
|
||||||
|
|
||||||
def txtPath(self):
|
def txtPath(self):
|
||||||
path = self.file.path
|
path = self.file.path
|
||||||
|
@ -49,10 +49,10 @@ class Document(models.Model):
|
||||||
class Image(models.Model):
|
class Image(models.Model):
|
||||||
file = models.FileField(upload_to='erang/images/')
|
file = models.FileField(upload_to='erang/images/')
|
||||||
title = models.CharField(max_length=255)
|
title = models.CharField(max_length=255)
|
||||||
contributor = models.ForeignKey(Contributor)
|
contributor = models.ForeignKey(Contributor, blank=True, null=True)
|
||||||
issue = models.ForeignKey(Issue)
|
issue = models.ForeignKey(Issue)
|
||||||
notes = models.TextField(blank=True)
|
notes = models.TextField(blank=True)
|
||||||
date_added = models.DateTimeField(default=datetime.datetime.now())
|
date_added = models.DateTimeField(default=datetime.datetime.now(), editable=False)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
Loading…
Reference in New Issue
Block a user