diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2013-12-24 11:12:17 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2013-12-24 11:12:17 +0100 |
commit | 16d7ad53f982f6efec34a21ea4709e52369a9754 (patch) | |
tree | 93a29f0cb888f8257abfed2b284c4c0fb13b9c47 /pyaggr3g470r | |
parent | Fixed mistyped HTML tag in templates. (diff) | |
download | newspipe-16d7ad53f982f6efec34a21ea4709e52369a9754.tar.gz newspipe-16d7ad53f982f6efec34a21ea4709e52369a9754.tar.bz2 newspipe-16d7ad53f982f6efec34a21ea4709e52369a9754.zip |
Improved models with a new index for articles.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/models.py | 4 |
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 } ] } |