mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-16 08:04:26 -04:00
support adding urls with tags directly via CLI and add page
This commit is contained in:
parent
5fb9ca389f
commit
f3a3d76439
6 changed files with 25 additions and 14 deletions
|
@ -116,9 +116,13 @@ class Snapshot(models.Model):
|
|||
from ..index import load_link_details
|
||||
return load_link_details(self.as_link())
|
||||
|
||||
def tags_str(self) -> str:
|
||||
def tags_str(self, nocache=True) -> str:
|
||||
cache_key = f'{self.id}-{(self.updated or self.added).timestamp()}-tags'
|
||||
calc_tags_str = lambda: ','.join(self.tags.order_by('name').values_list('name', flat=True))
|
||||
if nocache:
|
||||
tags_str = calc_tags_str()
|
||||
cache.set(cache_key, tags_str)
|
||||
return tags_str
|
||||
return cache.get_or_set(cache_key, calc_tags_str)
|
||||
|
||||
@cached_property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue