diff --git a/docs/guide/defining-documents.rst b/docs/guide/defining-documents.rst index b5655c7d..d38e6616 100644 --- a/docs/guide/defining-documents.rst +++ b/docs/guide/defining-documents.rst @@ -178,7 +178,7 @@ either a single field name, or a list or tuple of field names:: class User(Document): username = StringField(unique=True) first_name = StringField() - last_name = StringField(unique_with='last_name') + last_name = StringField(unique_with='first_name') Document collections ==================== diff --git a/docs/guide/querying.rst b/docs/guide/querying.rst index bad8b340..4447f7da 100644 --- a/docs/guide/querying.rst +++ b/docs/guide/querying.rst @@ -172,7 +172,7 @@ custom manager methods as you like:: @queryset_manager def live_posts(doc_cls, queryset): - return queryset.order_by('-date') + return queryset.filter(published=True) BlogPost(title='test1', published=False).save() BlogPost(title='test2', published=True).save()