better file display
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from pathlib import Path
|
||||
|
||||
from django.core.validators import FileExtensionValidator, ValidationError
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
@@ -221,3 +223,6 @@ class Bill(models.Model):
|
||||
def clean(self):
|
||||
if self.status is None:
|
||||
self.status = Bill.Status.SUBMITTED
|
||||
|
||||
def filename(self):
|
||||
return Path(self.file_field.name).name
|
||||
|
||||
Reference in New Issue
Block a user