app/soc/models/linkable.py
changeset 970 8b5611d5b053
parent 568 6713617751b4
child 1058 6acbbb68f032
equal deleted inserted replaced
969:b12de918d660 970:8b5611d5b053
    23 
    23 
    24 import re
    24 import re
    25 
    25 
    26 from google.appengine.ext import db
    26 from google.appengine.ext import db
    27 
    27 
    28 from django.utils.translation import ugettext_lazy
    28 from django.utils.translation import ugettext
    29 
    29 
    30 from soc.models import base
    30 from soc.models import base
    31 
    31 
    32 
    32 
    33 # start with ASCII digit or lowercase
    33 # start with ASCII digit or lowercase
   110   """
   110   """
   111   #: Required field storing "ID" used in URL links. Lower ASCII characters,
   111   #: Required field storing "ID" used in URL links. Lower ASCII characters,
   112   #: digits and underscores only.  Valid link IDs successfully match
   112   #: digits and underscores only.  Valid link IDs successfully match
   113   #: the LINK_ID_REGEX.
   113   #: the LINK_ID_REGEX.
   114   link_id = db.StringProperty(required=True,
   114   link_id = db.StringProperty(required=True,
   115       verbose_name=ugettext_lazy('Link ID'))
   115       verbose_name=ugettext('Link ID'))
   116   link_id.help_text = ugettext_lazy(
   116   link_id.help_text = ugettext(
   117       'Link ID is used as part of various URL links throughout the site.'
   117       'Link ID is used as part of various URL links throughout the site.'
   118       ' Lower ASCII characters, digits, and underscores only.')
   118       ' Lower ASCII characters, digits, and underscores only.')
   119 
   119 
   120   #: Optional Self Reference property to another Linkable entity which defines
   120   #: Optional Self Reference property to another Linkable entity which defines
   121   #: the "scope" of this Linkable entity. The back-reference in the Linkable 
   121   #: the "scope" of this Linkable entity. The back-reference in the Linkable 
   122   #: model is a Query named 'links'.
   122   #: model is a Query named 'links'.
   123   scope = db.SelfReferenceProperty(required=False,
   123   scope = db.SelfReferenceProperty(required=False,
   124       collection_name='links', verbose_name=ugettext_lazy('Link Scope'))
   124       collection_name='links', verbose_name=ugettext('Link Scope'))
   125   scope.help_text = ugettext_lazy(
   125   scope.help_text = ugettext(
   126       'Reference to another Linkable entity that defines the "scope" of'
   126       'Reference to another Linkable entity that defines the "scope" of'
   127       ' this Linkable entity.')
   127       ' this Linkable entity.')
   128 
   128 
   129   #: Hidden (not displayed to users or editable in forms) cache of the string
   129   #: Hidden (not displayed to users or editable in forms) cache of the string
   130   #: representation of the transitive closure of scopes, for use in URLs.
   130   #: representation of the transitive closure of scopes, for use in URLs.
   132   #: deeply-nested scopes can be prohibitively expensive.  The scope of an
   132   #: deeply-nested scopes can be prohibitively expensive.  The scope of an
   133   #: entity is not expected to change frequently (only for move, copy, and
   133   #: entity is not expected to change frequently (only for move, copy, and
   134   #: maybe re-parenting operations), so this property is not likely to need
   134   #: maybe re-parenting operations), so this property is not likely to need
   135   #: updating.
   135   #: updating.
   136   scope_path = db.StringProperty(required=False,
   136   scope_path = db.StringProperty(required=False,
   137       verbose_name=ugettext_lazy('Scope path'))
   137       verbose_name=ugettext('Scope path'))
   138   scope_path.help_text = ugettext_lazy(
   138   scope_path.help_text = ugettext(
   139       'Cache of the string form of the entity scope.')
   139       'Cache of the string form of the entity scope.')
   140 
   140