20 __authors__ = [ |
20 __authors__ = [ |
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
22 ] |
22 ] |
23 |
23 |
24 |
24 |
25 from soc.logic.models import base |
25 from soc.logic.models import work |
26 |
26 |
27 import soc.models.document |
27 import soc.models.document |
28 import soc.models.work |
28 import soc.models.work |
29 |
29 |
30 |
30 |
31 class Logic(base.Logic): |
31 class Logic(work.Logic): |
32 """Logic methods for the Document model |
32 """Logic methods for the Document model |
33 """ |
33 """ |
34 |
34 |
35 def __init__(self): |
35 def __init__(self, model=soc.models.document.Document, |
|
36 base_model=soc.models.work.Work): |
36 """Defines the name, key_name and model for this entity. |
37 """Defines the name, key_name and model for this entity. |
37 """ |
38 """ |
38 base.Logic.__init__(self, soc.models.document.Document, |
39 work.Logic.__init__(self, model=model, base_model=base_model) |
39 base_model=soc.models.work.Work) |
|
40 |
|
41 def getKeyValues(self, entity): |
|
42 """See base.Logic.getKeyNameValues. |
|
43 """ |
|
44 |
|
45 return [entity.scope_path, entity.link_id] |
|
46 |
|
47 def getKeyValuesFromFields(self, fields): |
|
48 """See base.Logic.getKeyValuesFromFields. |
|
49 """ |
|
50 |
|
51 return [fields['scope_path'], fields['link_id']] |
|
52 |
|
53 def getKeyFieldNames(self): |
|
54 """See base.Logic.getKeyFieldNames. |
|
55 """ |
|
56 |
|
57 return ['scope_path', 'link_id'] |
|
58 |
40 |
59 |
41 |
60 logic = Logic() |
42 logic = Logic() |