Changeset 12032 for main/waeup.ikoba/trunk/src/waeup/ikoba/documents
- Timestamp:
- 21 Nov 2014, 18:52:43 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/documents
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py
r12017 r12032 32 32 from waeup.ikoba.utils.helpers import attrs_to_fields, get_current_principal 33 33 from waeup.ikoba.utils.logger import Logger 34 from waeup.ikoba.documents.interfaces import IDocument, IDocument 34 from waeup.ikoba.documents.interfaces import ( 35 IDocument, IDocument, IDocumentsUtils) 35 36 from waeup.ikoba.documents.utils import generate_document_id 36 37 … … 52 53 return 53 54 54 #def __init__(self):55 # super(Document, self).__init__()56 # timestamp = ("%d" % int(time()*10000))[1:]57 # self.document_id = "d%s" % timestamp58 # return59 60 55 def __init__(self): 61 56 super(Document, self).__init__() … … 76 71 state = IWorkflowState(self).getState() 77 72 return state 73 74 @property 75 def translated_state(self): 76 try: 77 TRANSLATED_STATES = getUtility(IDocumentsUtils).TRANSLATED_STATES 78 ts = TRANSLATED_STATES[self.state] 79 return ts 80 except KeyError: 81 return 78 82 79 83 Document = attrs_to_fields(Document) -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py
r12018 r12032 19 19 from zope import schema 20 20 from waeup.ikoba.interfaces import ( 21 IIkobaObject, SimpleIkobaVocabulary,21 IIkobaObject, 22 22 ContextualDictSourceFactoryBase) 23 23 from waeup.ikoba.interfaces import MessageFactory as _ 24 24 25 25 26 class DocumentTypeSource(ContextualDictSourceFactoryBase): … … 46 47 history = Attribute('Object history, a list of messages') 47 48 state = Attribute('Returns the verification state of a document') 49 translated_state = Attribute( 50 'Returns a translated, more verbose verification state of a document') 48 51 49 52 title = schema.TextLine( -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/utils.py
r12018 r12032 19 19 """ 20 20 import grok 21 from waeup.ikoba.interfaces import MessageFactory as _ 21 22 from waeup.ikoba.documents.workflow import CREATED 22 23 from waeup.ikoba.documents.interfaces import IDocumentsUtils 24 from waeup.ikoba.documents.workflow import ( 25 CREATED, SUBMITTED, 26 VERIFIED, REJECTED, OUTDATED) 23 27 24 28 … … 34 38 35 39 DOCMANAGE_STATES = (CREATED,) 40 41 TRANSLATED_STATES = { 42 CREATED: _('document created'), 43 SUBMITTED: _('document submitted'), 44 VERIFIED: _('document verified'), 45 REJECTED: _('document rejected'), 46 OUTDATED:_('document outdated') 47 } -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/workflow.py
r12015 r12032 24 24 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 25 25 from waeup.ikoba.interfaces import ( 26 IObjectHistory, IIkobaWorkflowInfo, IIkobaUtils) 26 IObjectHistory, IIkobaWorkflowInfo, 27 SimpleIkobaVocabulary) 27 28 from waeup.ikoba.interfaces import MessageFactory as _ 28 29 from waeup.ikoba.workflow import IkobaWorkflow, IkobaWorkflowInfo
Note: See TracChangeset for help on using the changeset viewer.