Guest User

Untitled

a guest
Jan 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. class Action(MonkeyDocument):
  2. __collection__='actions'
  3. KIND_APPROVAL=u'approval request'
  4. KIND_MESSAGE=u'message'
  5. STATUS_DONE=u'done'
  6. STATUS_REJECTED=u'rejected'
  7. STATUS_PENDING=u'pending'
  8. STATUS_DELETED=u'deleted'
  9. CREATOR_SYSTEM=u'Monkey Application'
  10. LOCATION_INBOX=u'inbox'
  11. LOCATION_NONE=u''
  12.  
  13. structure={
  14. 'account':unicode,
  15. 'project':unicode,
  16. 'kind':IS(KIND_APPROVAL,KIND_MESSAGE),
  17. 'user_creator':{'account_member_id':unicode, 'user_name':unicode},
  18. 'created':datetime.datetime,
  19. 'message':unicode,
  20. 'payload':dict,
  21. 'destination':{'account_member_id':unicode, 'user_name':unicode, 'location':unicode},
  22. 'status':IS(STATUS_DONE,STATUS_PENDING,STATUS_DELETED,STATUS_REJECTED),
  23. 'root_action_id':unicode,
  24. 'dirty':bool,
  25. 'show_as_activity':bool
  26. }
  27.  
  28. required_fields = ['project','account', 'kind','user_creator.account_member_id','message']
  29. default_values = {'created':datetime.datetime.utcnow, 'kind':KIND_APPROVAL,
  30. 'status':STATUS_PENDING, 'dirty':False, 'show_as_activity':False,'destination.location':LOCATION_NONE}
Add Comment
Please, Sign In to add comment