Beispiel #1
0
    def _edit(self, edit_order=(), **kw):
      # XXX FIXME For now, special cases are handled in _edit methods in many
      # documents : DeliveryLine, DeliveryCell ... Ideally, to prevent code
      # duplication, it should be handled in a _edit method present only in
      # Amount.py

      # If variations and resources are set at the same time, resource must be
      # set before any variation.
      before_order = ('resource', 'resource_value',
                      'variation_base_category_list',
                      'variation_category_list')
      before_kw = {k: kw.pop(k) for k in before_order if k in kw}
      if before_kw:
        before_kw.update((k, kw[k]) for k in edit_args_list if k in kw)
        Base._edit(self, edit_order=before_order, **before_kw)
      if kw:
        Movement._edit(self, edit_order=edit_order, **kw)
Beispiel #2
0
    def _edit(self, edit_order=(), **kw):
      # XXX FIXME For now, special cases are handled in _edit methods in many
      # documents : DeliveryLine, DeliveryCell ... Ideally, to prevent code
      # duplication, it should be handled in a _edit method present only in
      # Amount.py

      # If variations and resources are set at the same time, resource must be
      # set before any variation.
      before_order = ('resource', 'resource_value',
                      'variation_base_category_list',
                      'variation_category_list')
      before_kw = {k: kw.pop(k) for k in before_order if k in kw}
      if before_kw:
        before_kw.update((k, kw[k]) for k in edit_args_list if k in kw)
        Base._edit(self, edit_order=before_order, **before_kw)
      if kw:
        Movement._edit(self, edit_order=edit_order, **kw)
Beispiel #3
0
    def _edit(self, REQUEST=None, force_update = 0, **kw):
      # XXX FIXME For now, special cases are handled in _edit methods in many
      # documents : DeliveryLine, DeliveryCell ... Ideally, to prevent code
      # duplication, it should be handled in a _edit method present only in
      # Amount.py

      # If variations and resources are set at the same time, resource must be
      # set before any variation.
      if kw.has_key('resource_value'):
        self._setResourceValue( kw['resource_value'] )
      # We must first prepare the variation_base_category_list before we do the edit of the rest
      #LOG('in edit', 0, str(kw))
      if kw.has_key('variation_base_category_list'):
        self._setVariationBaseCategoryList( kw['variation_base_category_list'] )
      if kw.has_key('variation_category_list'):
        self._setVariationCategoryList( kw['variation_category_list'] )
      Movement._edit(self, REQUEST=REQUEST,
                       force_update = force_update, **kw)
Beispiel #4
0
    def _edit(self, REQUEST=None, force_update=0, **kw):
        # XXX FIXME For now, special cases are handled in _edit methods in many
        # documents : DeliveryLine, DeliveryCell ... Ideally, to prevent code
        # duplication, it should be handled in a _edit method present only in
        # Amount.py

        # If variations and resources are set at the same time, resource must be
        # set before any variation.
        if kw.has_key('resource_value'):
            self._setResourceValue(kw['resource_value'])
        # We must first prepare the variation_base_category_list before we do the edit of the rest
        #LOG('in edit', 0, str(kw))
        if kw.has_key('variation_base_category_list'):
            self._setVariationBaseCategoryList(
                kw['variation_base_category_list'])
        if kw.has_key('variation_category_list'):
            self._setVariationCategoryList(kw['variation_category_list'])
        Movement._edit(self, REQUEST=REQUEST, force_update=force_update, **kw)