26 from google.appengine.api import users |
26 from google.appengine.api import users |
27 from google.appengine.ext import db |
27 from google.appengine.ext import db |
28 |
28 |
29 from django.utils.translation import ugettext_lazy |
29 from django.utils.translation import ugettext_lazy |
30 |
30 |
31 from soc.models import base |
31 import soc.models.linkable |
32 |
32 |
33 |
33 |
34 class User(base.ModelWithFieldAttributes): |
34 class User(soc.models.linkable.Linkable): |
35 """A user and associated login credentials, the fundamental identity entity. |
35 """A user and associated login credentials, the fundamental identity entity. |
36 |
36 |
37 User is a separate Model class from Person because the same login |
37 User is a separate Model class from Person because the same login |
38 ID may be used to, for example, serve as Contributor in one Program |
38 ID may be used to, for example, serve as Contributor in one Program |
39 and a Reviewer in another. |
39 and a Reviewer in another. |
78 #: (though this is not recommended), or a nick name or some other public |
78 #: (though this is not recommended), or a nick name or some other public |
79 #: alias. Public names can be any valid UTF-8 text. |
79 #: alias. Public names can be any valid UTF-8 text. |
80 public_name = db.StringProperty(required=True, |
80 public_name = db.StringProperty(required=True, |
81 verbose_name=ugettext_lazy('Public name')) |
81 verbose_name=ugettext_lazy('Public name')) |
82 |
82 |
83 #: Required field storing link_id used in URLs to identify user. |
|
84 #: Lower ASCII characters only. |
|
85 link_id = db.StringProperty(required=True, |
|
86 verbose_name=ugettext_lazy('Link ID')) |
|
87 link_id.help_text = ugettext_lazy( |
|
88 'Field used in URLs to identify user. ' |
|
89 'Lower ASCII characters only.') |
|
90 |
|
91 #: field storing whether User is a Developer with site-wide access. |
83 #: field storing whether User is a Developer with site-wide access. |
92 is_developer = db.BooleanProperty( |
84 is_developer = db.BooleanProperty( |
93 verbose_name=ugettext_lazy('Is Developer')) |
85 verbose_name=ugettext_lazy('Is Developer')) |
94 is_developer.help_text = ugettext_lazy( |
86 is_developer.help_text = ugettext_lazy( |
95 'Field used to indicate user with site-wide "Developer" access.') |
87 'Field used to indicate user with site-wide "Developer" access.') |