Ejemplo n.º 1
0
def search(request):
    section = "organizations"
    search_proxies = OrganizationsSearchProxy.objects_by_account(request.account).all()
    if 'q' in request.GET:
        q = request.GET['q']
        if q != "":
            search_proxies = OrganizationsSearchProxy.search(request.account, q,ignorable_chars=["-","(",")"])
    return locals()
Ejemplo n.º 2
0
def search_results(request):
    section = "organizations"
    search_proxies = OrganizationsSearchProxy.objects_by_account(request.account).all()
    if 'q' in request.GET:
        q = request.GET['q']
        if q != "":
            search_proxies = OrganizationsSearchProxy.search(request.account, q,ignorable_chars=["-","(",")"])

    return {"fragments":{"main_search_results":render_to_string("organizations/_search_results.html", locals())}}
Ejemplo n.º 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."
Ejemplo n.º 4
0
    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."