Changeset 1479 in main
- Timestamp:
- 07/17/12 10:05:36 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openPLM/plmapp/controllers/part.py
r1439 r1479 106 106 :type order: positive int 107 107 :param unit: a valid unit 108 109 Extra arguments are used to create relevant :class:`.ParentChildLinkExtension`. 108 110 109 111 :raises: :exc:`ValueError` if *child* is already a child or a parent. … … 144 146 145 147 .. 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. 147 150 148 151 :raises: :exc:`.PermissionError` if :attr:`_user` is not the owner of … … 171 174 :param new_order: order 172 175 :type new_order: positive int 176 177 Extra arguments are used to modify relevant :class:`.ParentChildLinkExtension`. 173 178 174 179 :raises: :exc:`.PermissionError` if :attr:`_user` is not the owner of … … 261 266 Returns a list of all children at time *date*. 262 267 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` 263 276 :rtype: list of :class:`Child` 264 277 """ … … 335 348 def get_parents(self, max_level=1, date=None, 336 349 related=("parent", "parent__state", "parent__lifecycle"), 337 only_official=False ):350 only_official=False, only=None): 338 351 """ 339 352 Returns a list of all parents at time *date*. 340 353 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` 341 362 :rtype: list of :class:`Parent` 342 363 """ … … 348 369 else: 349 370 links = objects.filter(ctime__lte=date).exclude(end_time__lt=date) 371 if only is not None: 372 links = links.only(*only) 350 373 res = [] 351 374 children = [self.object.id]
Note: See TracChangeset
for help on using the changeset viewer.