Changeset 1479 in main for trunk


Ignore:
Timestamp:
07/17/12 10:05:36 (9 years ago)
Author:
pcosquer
Message:

plmapp: docs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/controllers/part.py

    r1439 r1479  
    106106        :type order: positive int 
    107107        :param unit: a valid unit 
     108 
     109        Extra arguments are used to create relevant :class:`.ParentChildLinkExtension`. 
    108110         
    109111        :raises: :exc:`ValueError` if *child* is already a child or a parent. 
     
    144146 
    145147        .. note:: 
    146             The link is not destroyed: its end_time is set to now. 
     148            The link is not destroyed: its :attr:`.ParentChildLink.end_time` 
     149            is set to now. 
    147150         
    148151        :raises: :exc:`.PermissionError` if :attr:`_user` is not the owner of 
     
    171174        :param new_order: order 
    172175        :type new_order: positive int 
     176         
     177        Extra arguments are used to modify relevant :class:`.ParentChildLinkExtension`. 
    173178         
    174179        :raises: :exc:`.PermissionError` if :attr:`_user` is not the owner of 
     
    261266        Returns a list of all children at time *date*. 
    262267         
     268        :param max_level: maximum level of children, ``-1`` 
     269            returns all descendants, ``1`` returns direct children 
     270        :param related: a list of related fields that are given 
     271            to retrieve the :class:`.ParentChildLink` 
     272        :param only_official: True if the result should be pruned to 
     273            only include official children 
     274        :param only: a list of fields that are given to limit the 
     275            retrieved field of the :class:`.ParentChildLink` 
    263276        :rtype: list of :class:`Child` 
    264277        """ 
     
    335348    def get_parents(self, max_level=1, date=None, 
    336349            related=("parent", "parent__state", "parent__lifecycle"), 
    337             only_official=False): 
     350            only_official=False, only=None): 
    338351        """ 
    339352        Returns a list of all parents at time *date*. 
    340353         
     354        :param max_level: maximum level of parents, ``-1`` 
     355            returns all ancestors, ``1`` returns direct parents 
     356        :param related: a list of related fields that are given 
     357            to retrieve the :class:`.ParentChildLink` 
     358        :param only_official: True if the result should be pruned to 
     359            only include official parents 
     360        :param only: a list of fields that are given to limit the 
     361            retrieved field of the :class:`.ParentChildLink` 
    341362        :rtype: list of :class:`Parent` 
    342363        """ 
     
    348369        else: 
    349370            links = objects.filter(ctime__lte=date).exclude(end_time__lt=date) 
     371        if only is not None: 
     372            links = links.only(*only) 
    350373        res = [] 
    351374        children = [self.object.id] 
Note: See TracChangeset for help on using the changeset viewer.