소스 검색

[search] Update examples to Document2

Romain Rigaux 11 년 전
부모
커밋
148213b6cb
2개의 변경된 파일7개의 추가작업 그리고 41개의 파일을 삭제
  1. 0 35
      apps/search/src/search/fixtures/initial_search_examples.json
  2. 7 6
      apps/search/src/search/management/commands/search_setup.py

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 35
apps/search/src/search/fixtures/initial_search_examples.json


+ 7 - 6
apps/search/src/search/management/commands/search_setup.py

@@ -20,17 +20,18 @@ import logging
 from django.core import management
 from django.core.management.base import NoArgsCommand
 
-from desktop.models import Document
+from desktop.models import Document, Document2, SAMPLE_USERNAME
 from useradmin.models import install_sample_user
 
+
 LOG = logging.getLogger(__name__)
 
-# initial_search_examples.json: add 1000000 to the ids
 
 class Command(NoArgsCommand):
   def handle_noargs(self, **options):
 
-    # Load jobs
-#    install_sample_user()
-    management.call_command('loaddata', 'initial_search_examples.json', verbosity=2)
-    Document.objects.sync()
+    if not Document2.objects.filter(owner__username=SAMPLE_USERNAME).exists():
+      install_sample_user()
+
+      management.call_command('loaddata', 'initial_search_examples.json', verbosity=2)
+      Document.objects.sync()

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.