示例#1
0
def get_search_types():
    v_groups = TgGroup.objects.virtual()
    hubs = TgGroup.objects.hubs()
    #('All', (None, None, _('All')))
    return (
        ('Profile', ({
            'content_type__model': 'profile'
        }, None, _('Members'))),
        ('Group', ({
            'content_type__model': 'tggroup',
            'object_id__in': v_groups
        }, None, _('Groups'))),
        #(hub_name(),({'content_type__model':'tggroup'}, {'object_id__in':v_groups}, _(hub_name_plural()))),
        (hub_name(), ({
            'content_type__model': 'tggroup',
            'object_id__in': hubs
        }, None, _(hub_name_plural()))),
        ('Resource', ({
            'content_type__model__in': ['resource', 'wikipage']
        }, None, _('Resources'))),
    )
示例#2
0
    create_group = False

    if request.user.is_authenticated() :
        try :
            if current_app == 'groups' :
                site.create_virtual
            else :
                site.create_hub
            create_group = True
        except Exception, e:
            print "User can't create a group",e


    if type == 'hub' :
        head_title = _(hub_name_plural())
        type_name = hub_name()
    else:
        head_title = _('Groups')
        type_name = "Group"
        
    search_types = narrow_search_types(type_name)
    search_types_len = len(search_types)
    search_type_label = search_types[0][1][2]
    search_type = current_app + ':groups'
    tag_search_type = current_app + ':groups_tag'


    all_results, search_types, tag_intersection  = plus_search(tags, search, search_types, order)

    
示例#3
0
def get_search_types():
    v_groups = TgGroup.objects.virtual()
    hubs = TgGroup.objects.hubs()
    #('All', (None, None, _('All')))
    return (('Profile', ({'content_type__model':'profile'}, None, _('Members'))), 
            ('Group', ({'content_type__model':'tggroup', 'object_id__in':v_groups}, None, _('Groups'))), 
            #(hub_name(),({'content_type__model':'tggroup'}, {'object_id__in':v_groups}, _(hub_name_plural()))), 
            (hub_name(),({'content_type__model':'tggroup','object_id__in':hubs},None,_(hub_name_plural()))),
            ('Resource', ({'content_type__model__in':['resource', 'wikipage']}, None, _('Resources'))), 
            )
示例#4
0
        search_type = ''

    create_group = False
    if request.user.is_authenticated():

        try:
            if current_app == 'groups':
                site.create_virtual
            else :
                site.create_hub
            create_group = True
        except Exception, e:
            print "User can't create a group",e
 
    if type == 'hub':
        head_title = _(hub_name_plural())
        type_name = hub_name()
    else:
        head_title = _('Groups')
        type_name = "Group"

    # hmm shouldn't we just use current app to determine search_types?        
    search_types = narrow_search_types(type_name) 
    side_search = side_search_args(current_app + ':groups', search_types[0][1][2])

    listing_args_dict = listing_args(current_app + ':groups', current_app + ':groups_tag', tag_string=tag_string, search_terms=search, multitabbed=False, order=order, template_base="site_base.html", search_type_label=head_title)
    search_dict = plus_search(listing_args_dict['tag_filter'], search, search_types, order)

    return render_to_response(template_name, 
                              {'head_title':head_title,
                               'search':search_dict,