app/soc/views/models/base.py
changeset 677 c8f24e3078b8
parent 668 77f9a6ea6e67
child 701 d6f5d34cff5a
equal deleted inserted replaced
676:c6433532ddff 677:c8f24e3078b8
   506       entity: the entity to create or update from POST contents
   506       entity: the entity to create or update from POST contents
   507       fields: the new field values
   507       fields: the new field values
   508     """
   508     """
   509 
   509 
   510     # If scope_logic is not defined, this entity has no scope
   510     # If scope_logic is not defined, this entity has no scope
   511     if 'scope_logic' not in self._params:
   511     if not self._params['scope_logic']:
   512       return
   512       return
   513 
   513 
   514     scope = self._params['scope_logic'].logic.getFromKeyName(fields['scope_path'])
   514     scope = self._params['scope_logic'].logic.getFromKeyName(fields['scope_path'])
   515     fields['scope'] = scope
   515     fields['scope'] = scope
   516 
   516 
   533       entity: the entity to get
   533       entity: the entity to get
   534       form: the django form that will be used for the page
   534       form: the django form that will be used for the page
   535     """
   535     """
   536 
   536 
   537     # fill in the email field with the data from the entity
   537     # fill in the email field with the data from the entity
   538     form.fields['scope_path'].initial = entity.scope_path
   538     if 'scope_path' in form.fields:
       
   539       form.fields['scope_path'].initial = entity.scope_path
   539 
   540 
   540   def _editSeed(self, request, seed):
   541   def _editSeed(self, request, seed):
   541     """Performs any required processing on the form to get its edit page.
   542     """Performs any required processing on the form to get its edit page.
   542 
   543 
   543     Args:
   544     Args: