Changeset 325 in main


Ignore:
Timestamp:
09/22/11 14:00:54 (8 years ago)
Author:
pcosquer
Message:

formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/views/main.py

    r324 r325  
    174174def display_object_revisions(request, obj_type, obj_ref, obj_revi): 
    175175    """ 
    176     Manage html page which displays all revisions of (objects having :class:`RevisionLink` with) 
    177     the selected object. 
     176    Manage html page which displays all revisions of the selected object. 
    178177    It computes a context dictionnary based on 
    179178     
     
    209208def display_object_history(request, obj_type, obj_ref, obj_revi): 
    210209    """ 
    211     Manage html page which displays the history of (:class:`History` with) the selected object. 
     210    Manage html page which displays the history of the selected object. 
    212211    It computes a context dictionnary based on 
    213212     
     
    239238def display_object_child(request, obj_type, obj_ref, obj_revi): 
    240239    """ 
    241     Manage html page which displays the chidren of (:class:`ParentChildLink` with) the selected object. 
     240    Manage html page which displays the chidren of the selected object. 
    242241    It computes a context dictionnary based on 
    243242     
     
    284283def edit_children(request, obj_type, obj_ref, obj_revi): 
    285284    """ 
    286     Manage html page which edits the chidren of (:class:`ParentChildLink` with) the selected object. 
     285    Manage html page which edits the chidren of the selected object. 
    287286    Possibility to modify the `.ParentChildLink.order`, the `.ParentChildLink.quantity` and to 
    288287    desactivate the `.ParentChildLink` 
     
    321320def add_children(request, obj_type, obj_ref, obj_revi): 
    322321    """ 
    323     Manage html page for chidren creation of (:class:`ParentChildLink` creation with) the selected object. 
     322    Manage html page for chidren creation of the selected object. 
    324323    It computes a context dictionnary based on 
    325324     
     
    357356def display_object_parents(request, obj_type, obj_ref, obj_revi): 
    358357    """ 
    359     Manage html page which displays the parent of (:class:`ParentChildLink` with) the selected object. 
     358    Manage html page which displays the parent of the selected object. 
    360359    It computes a context dictionnary based on 
    361360     
     
    399398def display_object_doc_cad(request, obj_type, obj_ref, obj_revi): 
    400399    """ 
    401     Manage html page which displays the related documents and CAD of (:class:`DocumentPartLink` with) the selected object. 
     400    Manage html page which displays the related documents and CAD of  
     401    the selected object. 
    402402    It computes a context dictionnary based on 
    403403     
     
    732732 
    733733########################################################################################## 
    734 ###             Manage html pages for part / document creation and modification                     ### 
    735 ########################################################################################## 
    736 def get_non_modifyable_attributes_list(current_obj, current_user, Classe=models.PLMObject): 
     734###    Manage html pages for part / document creation and modification                 ### 
     735########################################################################################## 
     736def get_non_modifyable_attributes_list(current_obj, current_user, cls=models.PLMObject): 
    737737    """ 
    738738    Create a list of object's attributes we can't modify' and set them a value 
     
    747747         ('mtime', 'Date')] 
    748748     
    749     :param Classe: :class: instance of `models.PLMObject` 
     749    :param cls: :class: instance of `models.PLMObject` 
    750750    :return: list 
    751751    """ 
    752     non_modifyable_fields_list = Classe.excluded_creation_fields() 
     752    non_modifyable_fields_list = cls.excluded_creation_fields() 
    753753    non_modifyable_attributes_list=[] 
    754754    if current_obj == 'create': 
     
    863863def modify_user(request, obj_ref): 
    864864    """ 
    865     Manage html page for the modification of the selected :class:`~django.contrib.auth.models.User`. 
     865    Manage html page for the modification of the selected 
     866    :class:`~django.contrib.auth.models.User`. 
    866867    It computes a context dictionnary based on 
    867868     
     
    877878    obj, ctx, request_dict = get_generic_data(request, "User", obj_ref) 
    878879    class_for_div="ActiveBox4User" 
    879     if request.method == 'POST': 
    880         if request.POST: 
    881             modification_form = OpenPLMUserChangeForm(request.POST) 
    882             if modification_form.is_valid(): 
    883                 obj.cupdate_from_form(modification_form) 
    884                 return HttpResponseRedirect("/user/%s/" % obj.username) 
     880    if request.method == 'POST' and request.POST: 
     881        modification_form = OpenPLMUserChangeForm(request.POST) 
     882        if modification_form.is_valid(): 
     883            obj.cupdate_from_form(modification_form) 
     884            return HttpResponseRedirect("/user/%s/" % obj.username) 
    885885    else: 
    886886        modification_form = OpenPLMUserChangeForm(instance=obj.object) 
     
    893893def change_user_password(request, obj_ref): 
    894894    """ 
    895     Manage html page for the modification of the selected :class:`~django.contrib.auth.models.User` password. 
     895    Manage html page for the modification of the selected 
     896    :class:`~django.contrib.auth.models.User` password. 
    896897    It computes a context dictionnary based on 
    897898     
     
    910911    class_for_div="ActiveBox4User" 
    911912    if request.method == 'POST' and request.POST: 
    912             modification_form = PasswordChangeForm(obj, request.POST) 
    913             if modification_form.is_valid(): 
    914                 obj.set_password(modification_form.cleaned_data['new_password2']) 
    915                 obj.save() 
    916                 return HttpResponseRedirect("/user/%s/" % obj.username) 
     913        modification_form = PasswordChangeForm(obj, request.POST) 
     914        if modification_form.is_valid(): 
     915            obj.set_password(modification_form.cleaned_data['new_password2']) 
     916            obj.save() 
     917            return HttpResponseRedirect("/user/%s/" % obj.username) 
    917918    else: 
    918919        modification_form = PasswordChangeForm(obj) 
    919920    request.session.update(request_dict) 
    920     ctx.update({'class4div': class_for_div, 'modification_form': modification_form}) 
     921    ctx.update({'class4div': class_for_div, 
     922                'modification_form': modification_form}) 
    921923    return r2r('DisplayObject4PasswordModification.htm', ctx, request) 
    922924 
     
    951953def display_delegation(request, obj_ref): 
    952954    """ 
    953     Manage html page which displays the delegations of (:class:`DelegationLink` with) the selected :class:`~django.contrib.auth.models.User`. 
     955    Manage html page which displays the delegations of the selected  
     956    :class:`~django.contrib.auth.models.User`. 
    954957    It computes a context dictionnary based on 
    955958     
     
    981984def delegate(request, obj_ref, role, sign_level): 
    982985    """ 
    983     Manage html page for delegations modification of (:class:`DelegationLink` with) the selected :class:`~django.contrib.auth.models.User`. 
     986    Manage html page for delegations modification of the selected 
     987    :class:`~django.contrib.auth.models.User`. 
    984988    It computes a context dictionnary based on 
    985989     
     
    11001104     
    11011105    request.session.update(request_dict) 
    1102     if request.POST : 
     1106    if request.POST: 
    11031107        checkin_file_form = AddFileForm(request.POST, request.FILES) 
    11041108        if checkin_file_form.is_valid(): 
    1105             obj.checkin(models.DocumentFile.objects.get(id=file_id_value), request.FILES["filename"]) 
     1109            obj.checkin(models.DocumentFile.objects.get(id=file_id_value), 
     1110                        request.FILES["filename"]) 
    11061111            return HttpResponseRedirect(obj.plmobject_url + "files/") 
    11071112        else: 
Note: See TracChangeset for help on using the changeset viewer.