aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/models.py
diff options
context:
space:
mode:
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