aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/models.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2013-12-24 11:12:17 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2013-12-24 11:12:17 +0100
commit16d7ad53f982f6efec34a21ea4709e52369a9754 (patch)
tree93a29f0cb888f8257abfed2b284c4c0fb13b9c47 /pyaggr3g470r/models.py
parentFixed mistyped HTML tag in templates. (diff)
downloadnewspipe-16d7ad53f982f6efec34a21ea4709e52369a9754.tar.gz
newspipe-16d7ad53f982f6efec34a21ea4709e52369a9754.tar.bz2
newspipe-16d7ad53f982f6efec34a21ea4709e52369a9754.zip
Improved models with a new index for articles.
Diffstat (limited to 'pyaggr3g470r/models.py')
-rw-r--r--pyaggr3g470r/models.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pyaggr3g470r/models.py b/pyaggr3g470r/models.py
index 718ff19a..4a2b4983 100644
--- a/pyaggr3g470r/models.py
+++ b/pyaggr3g470r/models.py
@@ -86,7 +86,7 @@ class Article(Document):
Defines the model for an article.
"""
date = DateTimeField(required=True)
- link = StringField(required=True)
+ link = StringField(required=True, unique=True)
title = StringField(required=True)
content = StringField(required=True)
readed = BooleanField()
@@ -98,6 +98,8 @@ class Article(Document):
'indexes': [
{'fields': ['-date'],
'sparse': True, 'types': False },
+ {'fields': ['link'],
+ 'sparse': True, 'unique': True, 'types': False }
]
}
bgstack15