This commit is contained in:
Sascha Ißbrücker 2019-07-02 02:05:09 +02:00
parent e07da529f1
commit d2f896966a
2 changed files with 2 additions and 4 deletions

View File

@ -57,7 +57,7 @@ class Bookmark(models.Model):
@property
def tag_names(self):
# If tag projections were loaded then avoid querying all tags (=executing further selects)
if self.tag_string or self.tag_projection:
if self.tag_projection:
return parse_tag_string(self.tag_string)
else:
return [tag.name for tag in self.tags.all()]
@ -66,9 +66,6 @@ class Bookmark(models.Model):
return self.resolved_title + ' (' + self.url[:30] + '...)'
auto_fill_placeholder = 'Leave empty to fill from website metadata'
class BookmarkForm(forms.ModelForm):
# Use URLField for URL
url = forms.URLField()

View File

@ -5,6 +5,7 @@ from django.utils import timezone
from bookmarks.models import Tag
def get_or_create_tags(tag_names: List[str], user: User):
return [get_or_create_tag(tag_name, user) for tag_name in tag_names]