app/soc/logic/models/base.py
changeset 407 3cf5630d86d1
parent 403 d3e545a8bd26
child 410 2af7f84f4fc7
equal deleted inserted replaced
406:cc603a815cad 407:3cf5630d86d1
   149     Args:
   149     Args:
   150       fields: a dictionary with the values for all the key_fields
   150       fields: a dictionary with the values for all the key_fields
   151           of this entity.
   151           of this entity.
   152     """
   152     """
   153 
   153 
       
   154     if not entity:
       
   155       return None
       
   156     
   154     suffix = []
   157     suffix = []
   155 
   158 
   156     for field in entity.KEY_FIELDS:
   159     for field in entity.KEY_FIELDS:
   157       # Four hours wasted on this line, because apparently passing in a dict
   160       # Four hours wasted on this line, because apparently passing in a dict
   158       # one time, and a db.Model the next time, things get rather hard to debug
   161       # one time, and a db.Model the next time, things get rather hard to debug