app/soc/logic/models/user.py
changeset 434 a4fc430fefac
parent 432 1851d67a1004
child 448 075360be6743
equal deleted inserted replaced
433:001b981be45e 434:a4fc430fefac
    38 
    38 
    39     self._name = "User"
    39     self._name = "User"
    40     self._model = soc.models.user.User
    40     self._model = soc.models.user.User
    41     self._skip_properties = ['former_ids']
    41     self._skip_properties = ['former_ids']
    42 
    42 
       
    43   def getKeyValues(self, entity):
       
    44     """See base.Logic.getKeyNameValues.
       
    45     """
       
    46 
       
    47     return [entity.link_name]
       
    48 
       
    49   def getKeyValuesFromFields(self, fields):
       
    50     """See base.Logic.getKeyValuesFromFields.
       
    51     """
       
    52 
       
    53     properties = {
       
    54         'link_name': fields['link_name']
       
    55         }
       
    56 
       
    57     entity = self.getForFields(properties, unique=True)
       
    58     return [entity.id.email()]
       
    59 
       
    60   def getKeyFieldNames(self):
       
    61     """See base.Logic.getKeyFieldNames
       
    62     """
       
    63 
       
    64     return ['email']
       
    65 
    43   def _updateField(self, model, name, value):
    66   def _updateField(self, model, name, value):
    44     """Special case logic for id.
    67     """Special case logic for id.
    45 
    68 
    46     When the id is changed, the former_ids field should be appended
    69     When the id is changed, the former_ids field should be appended
    47     with the old id.
    70     with the old id.