app/soc/tasks/helper/__init__.py
author Lennard de Rijk <ljvderijk@gmail.com>
Wed, 30 Sep 2009 21:26:50 +0200
changeset 2995 5931e6d6056f
parent 2614 dbc8a50dbce0
permissions -rw-r--r--
Changed the working of the iterative_task decorator. The decorator now needs the logic for the model which it fetches. This is much nicer then "fetching" it using import. Also order has been removed since it has no use when iterating over all entities when key is involved. Fields to filter can now dynamically be set by the function that is wrapped. Note that it will merge the filter with the task_default kwarg and it will only use the start_key if their is no key present in the context. Also note that task_default gathers all kwargs. I tried to do it otherwise (with default kwargs) but I couldn't get it to work. Feel free to improve :).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2614
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     1
#
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     2
# Copyright 2009 the Melange authors.
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     3
#
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     4
# Licensed under the Apache License, Version 2.0 (the "License");
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     5
# you may not use this file except in compliance with the License.
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     6
# You may obtain a copy of the License at
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     7
# 
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     8
#   http://www.apache.org/licenses/LICENSE-2.0
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     9
# 
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    10
# Unless required by applicable law or agreed to in writing, software
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    11
# distributed under the License is distributed on an "AS IS" BASIS,
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    13
# See the License for the specific language governing permissions and
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    14
# limitations under the License.
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    15
dbc8a50dbce0 Refactored logErrorAndReturnOK into separate module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    16
"""This module contains Melange Task API related helper modules."""