app/soc/logic/models/program.py
changeset 769 a0ee643fe832
parent 671 2c02178037ff
child 778 bc13cd968946
equal deleted inserted replaced
768:002d3141ff99 769:a0ee643fe832
    17 """Program (Model) query functions.
    17 """Program (Model) query functions.
    18 """
    18 """
    19 
    19 
    20 __authors__ = [
    20 __authors__ = [
    21   '"Sverre Rabbelier" <sverre@rabbelier.nl>',
    21   '"Sverre Rabbelier" <sverre@rabbelier.nl>',
       
    22   '"Lennard de Rijk" <ljvderijk@gmail.com>',
    22   ]
    23   ]
    23 
    24 
    24 
    25 
    25 from soc.logic.models import base
    26 from soc.logic.models import base
    26 from soc.logic.models import sponsor as sponsor_logic
    27 from soc.logic.models import sponsor as sponsor_logic
    37     """Defines the name, key_name and model for this entity.
    38     """Defines the name, key_name and model for this entity.
    38     """
    39     """
    39 
    40 
    40     super(Logic, self).__init__(model=model, base_model=base_model,
    41     super(Logic, self).__init__(model=model, base_model=base_model,
    41                                 scope_logic=scope_logic)
    42                                 scope_logic=scope_logic)
       
    43     
       
    44   def getKeyValues(self, entity):
       
    45     """See base.Logic.getKeyNameValues.
       
    46     """
       
    47 
       
    48     return [entity.scope_path, entity.workflow, entity.link_id]
       
    49 
       
    50   def getKeyValuesFromFields(self, fields):
       
    51     """See base.Logic.getKeyValuesFromFields.
       
    52     """
       
    53 
       
    54     return [fields['scope_path'], fields['workflow'], fields['link_id']]
       
    55 
       
    56   def getKeyFieldNames(self):
       
    57     """See base.Logic.getKeyFieldNames.
       
    58     """
       
    59 
       
    60     return ['scope_path', 'workflow', 'link_id']
    42 
    61 
    43 
    62 
    44 logic = Logic()
    63 logic = Logic()