Translated Model fields - primarily for backend.
This commit is contained in:
@@ -53,13 +53,18 @@ class Submittable(models.Model):
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
submitted_when = models.DateTimeField(auto_now_add=True, null=True)
|
||||
submitted_when = models.DateTimeField(
|
||||
auto_now_add=True,
|
||||
null=True,
|
||||
verbose_name=_('Submission date')
|
||||
)
|
||||
submitted_by = models.ForeignKey(
|
||||
'Explorer',
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
blank=True,
|
||||
related_name='%(class)ss'
|
||||
related_name='%(class)ss',
|
||||
verbose_name=_('Submitter')
|
||||
)
|
||||
|
||||
class Expireable(models.Model):
|
||||
@@ -69,8 +74,13 @@ class Expireable(models.Model):
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
created_when = models.DateTimeField(auto_now_add=True)
|
||||
expires_when = models.DateTimeField()
|
||||
created_when = models.DateTimeField(
|
||||
auto_now_add=True,
|
||||
verbose_name=_('Creation date')
|
||||
)
|
||||
expires_when = models.DateTimeField(
|
||||
verbose_name=_('Expiration date')
|
||||
)
|
||||
|
||||
@property
|
||||
def is_expired(self):
|
||||
|
@@ -138,4 +138,4 @@ def auto_delete_file_on_change(sender, instance, **kwargs):
|
||||
new_file = instance.filename
|
||||
if not old_file == new_file:
|
||||
if os.path.isfile(old_file.path):
|
||||
os.remove(old_file.path)
|
||||
os.remove(old_file.path)
|
||||
|
Reference in New Issue
Block a user