app/soc/models/linkable.py
changeset 510 6cd4f44891e5
parent 503 65e4d3ed3fc3
child 524 774b379e058c
equal deleted inserted replaced
509:e8acc0a907fb 510:6cd4f44891e5
    88   be allowed. 
    88   be allowed. 
    89   """
    89   """
    90   #: Required field storing "ID" used in URLS. Lower ASCII characters,
    90   #: Required field storing "ID" used in URLS. Lower ASCII characters,
    91   #: digits and underscores only.  Valid link IDs successfully match
    91   #: digits and underscores only.  Valid link IDs successfully match
    92   #: the LINK_ID_REGEX.
    92   #: the LINK_ID_REGEX.
    93   id = db.StringProperty(required=True,
    93   link_id = db.StringProperty(required=True,
    94       verbose_name=ugettext_lazy('Link ID'))
    94       verbose_name=ugettext_lazy('Link ID'))
    95   id.help_text = ugettext_lazy(
    95   link_id.help_text = ugettext_lazy(
    96       '"ID" used in URLs.'
    96       '"ID" used when creating URL links.'
    97       ' Lower ASCII characters, digits, and underscores only.')
    97       ' Lower ASCII characters, digits, and underscores only.')
    98 
    98 
    99   #: Optional Self Reference property to another Linkable entity which defines
    99   #: Optional Self Reference property to another Linkable entity which defines
   100   #: the "scope" of this Linkable entity. The back-reference in the Linkable 
   100   #: the "scope" of this Linkable entity. The back-reference in the Linkable 
   101   #: model is a Query named 'links'.
   101   #: model is a Query named 'links'.
   102   scope = db.SelfReferenceProperty(required=False,
   102   scope = db.SelfReferenceProperty(required=False,
   103       collection_name='links', verbose_name=ugettext_lazy('Link Scope'))
   103       collection_name='links', verbose_name=ugettext_lazy('Link Scope'))
   104   scope.help_text = ugettext_lazy(
   104   scope.help_text = ugettext_lazy(
   105       'Reference to another Linkable entity that defines the "scope" of'
   105       'Reference to another Linkable entity that defines the "scope" of'
   106       ' this Linkable entity.')
   106       ' this Linkable entity.')
       
   107 
       
   108   #: Hidden (not displayed to users or editable in forms) cache of the string
       
   109   #: representation of the transitive closure of scopes, for use in URLs.
       
   110   #: The multiple queries required to produce this string for entities in
       
   111   #: deeply-nested scopes can be prohibitively expensive.  The scope of an
       
   112   #: entity is not expected to change frequently (only for move, copy, and
       
   113   #: maybe re-parenting operations), so this property is not likely to need
       
   114   #: updating.
       
   115   scope_path = db.StringProperty(required=False,
       
   116       verbose_name=ugettext_lazy('Scope path'))
       
   117   scope_path.help_text = ugettext_lazy(
       
   118       'Cache of the string form of the entity scope.')
       
   119