コード例 #1
0
ファイル: views.py プロジェクト: skoczen/mycelium
def search(request):
    search_proxies = PeopleSearchProxy.objects_by_account(request.account).all()
    if 'q' in request.GET:
        q = request.GET['q']
        if q != "":
            search_proxies = PeopleSearchProxy.search(request.account, q,ignorable_chars=["-","(",")"])
    return locals()
コード例 #2
0
ファイル: views.py プロジェクト: skoczen/mycelium
def search_results(request):
    search_proxies = PeopleSearchProxy.objects_by_account(request.account).all()
    if 'q' in request.GET:
        q = request.GET['q']
        if q != "":
            search_proxies = PeopleSearchProxy.search(request.account, q,ignorable_chars=["-","(",")"])

    return {"fragments":{"main_search_results":render_to_string("people/_search_results.html", locals())}}
コード例 #3
0
    def forwards(self, orm):
        "Write your forwards methods here."
        print "Starting update of search proxies. Clearing old proxies..."
        cache.clear()
        PeopleSearchProxy.objects.all().delete()
        print "Organizations cleared."
        OrganizationsSearchProxy.objects.all().delete()
        print "People cleared."

        print "Re-saving organizations..."
        OrganizationsSearchProxy.resave_all_organizations(verbose=True)
        print "Re-saving people..."
        PeopleSearchProxy.resave_all_people(verbose=True)
        print "Invalidating cache.."
        
        jcache.invalidate(PeopleSearchProxy)
        jcache.invalidate(OrganizationsSearchProxy)
        print "Done."
コード例 #4
0
ファイル: repopulate_caches.py プロジェクト: skoczen/mycelium
    def handle(self, *args, **options):
        from people.models import PeopleSearchProxy
        from organizations.models import OrganizationsSearchProxy
        from groups.models import GroupSearchProxy
        from spreadsheets.models import SpreadsheetSearchProxy

        print "Repopulating people...",
        PeopleSearchProxy.populate_cache()
        print "done."
        print "Repopulating organizations..."
        OrganizationsSearchProxy.populate_cache()
        print "done."
        print "Repopulating groups..."
        GroupSearchProxy.populate_cache()
        print "done."
        print "Repopulating spreadsheets..."
        SpreadsheetSearchProxy.populate_cache()
        print "done."