equal
deleted
inserted
replaced
21 ] |
21 ] |
22 |
22 |
23 |
23 |
24 import re |
24 import re |
25 |
25 |
|
26 import polymodel |
|
27 |
26 from google.appengine.ext import db |
28 from google.appengine.ext import db |
27 |
29 |
28 from django.utils.translation import ugettext_lazy |
30 from django.utils.translation import ugettext_lazy |
29 |
|
30 from soc.models import base |
|
31 |
31 |
32 |
32 |
33 # start with ASCII digit or lowercase |
33 # start with ASCII digit or lowercase |
34 # (additional ASCII digit or lowercase |
34 # (additional ASCII digit or lowercase |
35 # -OR- |
35 # -OR- |
43 LINK_ID_ARG_PATTERN = r'(?P<link_id>%s)' % LINK_ID_PATTERN_CORE |
43 LINK_ID_ARG_PATTERN = r'(?P<link_id>%s)' % LINK_ID_PATTERN_CORE |
44 LINK_ID_PATTERN = r'^%s$' % LINK_ID_PATTERN_CORE |
44 LINK_ID_PATTERN = r'^%s$' % LINK_ID_PATTERN_CORE |
45 LINK_ID_REGEX = re.compile(LINK_ID_PATTERN) |
45 LINK_ID_REGEX = re.compile(LINK_ID_PATTERN) |
46 |
46 |
47 |
47 |
48 class Linkable(base.ModelWithFieldAttributes): |
48 class Linkable(polymodel.PolyModel): |
49 """A base class for Model classes that are "linkable". |
49 """A base class for Model classes that are "linkable". |
50 |
50 |
51 Many entities in Melange are identified by a "link path" that is formed |
51 Many entities in Melange are identified by a "link path" that is formed |
52 by two components: a "link scope" and a "link ID". |
52 by two components: a "link scope" and a "link ID". |
53 |
53 |