Changeset 308 in main


Ignore:
Timestamp:
09/21/11 10:17:17 (8 years ago)
Author:
pcosquer
Message:

s/display_global_page/get_generic_data/

Location:
trunk/openPLM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/cad/views.py

    r307 r308  
    3232    """ Manage html page for attributes """ 
    3333    obj_type = "FreeCAD" 
    34     obj, context_dict, request_dict = pviews.display_global_page(request, obj_type, obj_ref, obj_revi) 
     34    obj, context_dict, request_dict = pviews.get_generic_data(request, obj_type, obj_ref, obj_revi) 
    3535    object_attributes_list = [] 
    3636    for attr in obj.attributes: 
  • trunk/openPLM/plmapp/views.py

    r307 r308  
    145145########################################################################################## 
    146146 
    147 def display_global_page(request_dict, type_='-', reference='-', revision='-'): 
     147def get_generic_data(request_dict, type_='-', reference='-', revision='-'): 
    148148    """ 
    149149    Get a request and return a controller, a context dictionnary with elements common to all pages 
     
    253253    :return: a :class:`django.http.HttpResponse` 
    254254    """ 
    255     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     255    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    256256     
    257257    object_attributes_list = [] 
     
    297297    :return: a :class:`django.http.HttpResponse` 
    298298    """ 
    299     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     299    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    300300    if request.method == 'POST': 
    301301        if request.POST["action"] == "DEMOTE": 
     
    335335    :return: a :class:`django.http.HttpResponse` 
    336336    """ 
    337     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     337    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    338338     
    339339    if obj.is_revisable(): 
     
    369369    :return: a :class:`django.http.HttpResponse` 
    370370    """ 
    371     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     371    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    372372    if isinstance(obj, UserController): 
    373373        histos = models.UserHistory.objects 
     
    401401    :return: a :class:`django.http.HttpResponse` 
    402402    """ 
    403     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     403    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    404404     
    405405    if not hasattr(obj, "get_children"): 
     
    447447    :return: a :class:`django.http.HttpResponse` 
    448448    """ 
    449     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     449    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    450450     
    451451    if not hasattr(obj, "get_children"): 
     
    482482    :return: a :class:`django.http.HttpResponse` 
    483483    """ 
    484     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     484    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    485485    request.session.update(request_dict) 
    486486     
     
    522522    :return: a :class:`django.http.HttpResponse` 
    523523    """ 
    524     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     524    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    525525     
    526526    if not hasattr(obj, "get_parents"): 
     
    563563    :return: a :class:`django.http.HttpResponse` 
    564564    """ 
    565     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     565    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    566566     
    567567    if not hasattr(obj, "get_attached_documents"): 
     
    597597    :return: a :class:`django.http.HttpResponse` 
    598598    """ 
    599     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     599    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    600600     
    601601    request.session.update(request_dict) 
     
    637637    :return: a :class:`django.http.HttpResponse` 
    638638    """ 
    639     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     639    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    640640     
    641641    if not hasattr(obj, "get_attached_parts"): 
     
    670670    :return: a :class:`django.http.HttpResponse` 
    671671    """ 
    672     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     672    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    673673     
    674674    request.session.update(request_dict) 
     
    708708    :return: a :class:`django.http.HttpResponse` 
    709709    """ 
    710     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     710    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    711711     
    712712 
     
    741741    :return: a :class:`django.http.HttpResponse` 
    742742    """ 
    743     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     743    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    744744     
    745745    request.session.update(request_dict) 
     
    777777    :return: a :class:`django.http.HttpResponse` 
    778778    """ 
    779     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     779    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    780780     
    781781    object_management_list = models.PLMObjectUserLink.objects.filter(plmobject=obj) 
     
    803803    :return: a :class:`django.http.HttpResponse` 
    804804    """ 
    805     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     805    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    806806    link = models.PLMObjectUserLink.objects.get(id=int(link_id)) 
    807807    if obj.object.id != link.plmobject.id: 
     
    851851    :return: a :class:`django.http.HttpResponse` 
    852852    """ 
    853     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     853    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    854854     
    855855    if request.method == "POST": 
     
    954954    :return: a :class:`django.http.HttpResponse` 
    955955    """ 
    956 #    context_dict, request_dict = display_global_page(request) 
    957     obj, context_dict, request_dict = display_global_page(request) 
     956#    context_dict, request_dict = get_generic_data(request) 
     957    obj, context_dict, request_dict = get_generic_data(request) 
    958958    request.session.update(request_dict) 
    959959    if request.method == 'GET': 
     
    10041004    :return: a :class:`django.http.HttpResponse` 
    10051005    """ 
    1006     current_object, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     1006    current_object, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    10071007    if obj_type=='User': 
    10081008        cls = models.get_all_plmobjects()['UserProfile'] 
     
    10441044    :return: a :class:`django.http.HttpResponse` 
    10451045    """ 
    1046     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     1046    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    10471047    current_object = get_obj(obj_type, obj_ref, obj_revi, request.user) 
    10481048    class_for_div="ActiveBox4User" 
     
    10791079    if request.user.username=='test': 
    10801080        return HttpResponseRedirect("/user/%s/attributes/" % request.user) 
    1081     current_object, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     1081    current_object, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    10821082    class_for_div="ActiveBox4User" 
    10831083    if request.method == 'POST': 
     
    11131113    :return: a :class:`django.http.HttpResponse` 
    11141114    """ 
    1115     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     1115    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    11161116     
    11171117    if not hasattr(obj, "get_object_user_links"): 
     
    11391139    :return: a :class:`django.http.HttpResponse` 
    11401140    """ 
    1141     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     1141    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    11421142     
    11431143    if not hasattr(obj, "get_user_delegation_links"): 
     
    11731173    :return: a :class:`django.http.HttpResponse` 
    11741174    """ 
    1175     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     1175    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    11761176     
    11771177    if request.method == "POST": 
     
    12301230    :return: a :class:`django.http.HttpResponse` 
    12311231    """ 
    1232     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     1232    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    12331233     
    12341234    if request.method == "POST": 
     
    12831283    :return: a :class:`django.http.HttpResponse` 
    12841284    """ 
    1285     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     1285    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    12861286     
    12871287    request.session.update(request_dict) 
     
    13541354 
    13551355def get_navigate_data(request, obj_type, obj_ref, obj_revi): 
    1356     obj, context_dict, request_dict = display_global_page(request, obj_type, obj_ref, obj_revi) 
     1356    obj, context_dict, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    13571357    request.session.update(request_dict) 
    13581358    FilterForm = get_navigate_form(obj) 
Note: See TracChangeset for help on using the changeset viewer.