Changeset 1029 in main


Ignore:
Timestamp:
04/24/12 15:45:34 (7 years ago)
Author:
pcosquer
Message:

views: rewrite some docs

File:
1 edited

Legend:

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

    r1028 r1029  
    312312def display_object_revisions(request, obj_type, obj_ref, obj_revi): 
    313313    """ 
    314     Manage html page which displays all revisions of the selected object. 
    315     It computes a context dictionnary based on 
    316      
    317     .. include:: views_params.txt  
     314    View that displays the revisions of the given object (a part or 
     315    a document) and shows a form to make a new revision. 
     316     
     317    :url: :samp:`/object/{obj_type}/{obj_ref}/{obj_revi}/revisions/` 
     318     
     319    .. include:: views_params.txt  
     320 
     321    This view returns the result of :func:`revise_document`  
     322    if the object is a document and the result of :func:`revise_part` 
     323    if the object is a part. 
    318324    """ 
    319325    obj, ctx = get_generic_data(request, obj_type, obj_ref, obj_revi) 
     
    325331 
    326332def revise_document(obj, ctx, request): 
    327     """ View to revise a document. """ 
     333    """ 
     334    View to revise a document. 
     335 
     336    :param obj: displayed document 
     337    :type obj: :class:`.DocumentController` 
     338    :param ctx: initial context 
     339    :type ctx: dict 
     340    :param request: riven request 
     341   
     342    This view can create a new revision of the document, it required 
     343    the following POST parameters: 
     344 
     345    :post params: 
     346        revision 
     347            new revision of the document 
     348        a valid :class:`.SelectPartFormset` 
     349            Only required if *confirmation* is True, see below. 
     350 
     351 
     352    A revised document may be attached to some parts. 
     353    These parts are given by :meth:`.DocumentController.get_suggested_parts`. 
     354    If there is at least one suggested part, a confirmation of which 
     355    parts will be attached to the new document is required. 
     356 
     357    **Template:** 
     358     
     359    :file:`documents/revisions.html` 
     360 
     361    **Context:** 
     362 
     363    ``RequestContext`` 
     364 
     365    ``confirmation`` 
     366        True if a confirmation is required to revise the document. 
     367 
     368    ``revisions`` 
     369        list of revisions of the document 
     370     
     371    ``add_revision_form`` 
     372        form to revise the document. Only set if the document is revisable. 
     373 
     374    ``part_formset`` 
     375        a :class:`.SelectPartFormset` of parts that the new revision 
     376        may be attached to. Only set if *confirmation* is True. 
     377    """ 
    328378    confirmation = False 
    329379    if obj.is_revisable(): 
     
    368418 
    369419def revise_part(obj, ctx, request): 
    370     """ View to revise a part. """ 
     420    """ View to revise a part. 
     421     
     422    :param obj: displayed part 
     423    :type obj: :class:`.PartController` 
     424    :param ctx: initial context 
     425    :type ctx: dict 
     426    :param request: riven request 
     427   
     428    This view can create a new revision of the part, it required 
     429    the following POST parameters: 
     430 
     431    :post params: 
     432        revision 
     433            new revision of the part 
     434        a valid :class:`.SelectParentFormset` 
     435            Only required if *confirmation* is True, see below. 
     436        a valid :class:`.SelectDocumentFormset` 
     437            Only required if *confirmation* is True, see below. 
     438        a valid :class:`.SelectParentFormset` 
     439            Only required if *confirmation* is True, see below. 
     440 
     441    A revised part may be attached to some documents. 
     442    These documents are given by :meth:`.PartController.get_suggested_documents`. 
     443    A revised part may also have some children from the original revision. 
     444    A revised part may also replace some parts inside a parent BOM. 
     445    These parents are given by :meth:`.PartController.get_suggested_parents`. 
     446 
     447    If there is at least one suggested object, a confirmation is required. 
     448 
     449    **Template:** 
     450     
     451    :file:`parts/revisions.html` 
     452 
     453    **Context:** 
     454 
     455    ``RequestContext`` 
     456 
     457    ``confirmation`` 
     458        True if a confirmation is required to revise the part. 
     459 
     460    ``revisions`` 
     461        list of revisions of the part 
     462     
     463    ``add_revision_form`` 
     464        form to revise the part. Only set if the document is revisable. 
     465 
     466    ``doc_formset`` 
     467        a :class:`.SelectDocmentFormset` of documents that the new revision 
     468        may be attached to. Only set if *confirmation* is True. 
     469 
     470    ``children_formset`` 
     471        a :class:`.SelectChildFormset` of parts that the new revision 
     472        will be composed of. Only set if *confirmation* is True. 
     473     
     474    ``parents_formset`` 
     475        a :class:`.SelectParentFormset` of parts that the new revision 
     476        will be added to, it will replace the previous revisions 
     477        in the parent's BOM. 
     478        Only set if *confirmation* is True. 
     479    """ 
    371480    confirmation = False 
    372481    if obj.is_revisable(): 
Note: See TracChangeset for help on using the changeset viewer.