fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Filter top-level books.
[wolnelektury.git]
/
src
/
chunks
/
models.py
diff --git
a/src/chunks/models.py
b/src/chunks/models.py
index
56166a3
..
f5fdbbf
100644
(file)
--- a/
src/chunks/models.py
+++ b/
src/chunks/models.py
@@
-4,6
+4,7
@@
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.conf import settings
from django.core.cache import cache
from django.db import models
+from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext_lazy as _
@@
-42,3
+43,6
@@
class Attachment(models.Model):
def __str__(self):
return self.key
def __str__(self):
return self.key
+
+ def get_absolute_url(self):
+ return reverse('chunks_attachment', args=[self.key, self.attachment.name.rsplit('.', 1)[-1]])