Mercurial > p > roundup > code
comparison roundup/hyperdb.py @ 5063:2840a9e86ef2
New Link/Multilink attribute 'msg_header_property'
.. can be used to configure additional headers in outgoing emails.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Tue, 10 May 2016 16:26:24 +0200 |
| parents | 9792b18e0b19 |
| children | e424987d294a |
comparison
equal
deleted
inserted
replaced
| 5062:2ac11cc397eb | 5063:2840a9e86ef2 |
|---|---|
| 130 | 130 |
| 131 class _Pointer(_Type): | 131 class _Pointer(_Type): |
| 132 """An object designating a Pointer property that links or multilinks | 132 """An object designating a Pointer property that links or multilinks |
| 133 to a node in a specified class.""" | 133 to a node in a specified class.""" |
| 134 def __init__(self, classname, do_journal='yes', try_id_parsing='yes', | 134 def __init__(self, classname, do_journal='yes', try_id_parsing='yes', |
| 135 required=False, default_value=None): | 135 required=False, default_value=None, |
| 136 msg_header_property = None): | |
| 136 """ Default is to journal link and unlink events. | 137 """ Default is to journal link and unlink events. |
| 137 When try_id_parsing is false, we don't allow IDs in input | 138 When try_id_parsing is false, we don't allow IDs in input |
| 138 fields (the key of the Link or Multilink property must be | 139 fields (the key of the Link or Multilink property must be |
| 139 given instead). This is useful when the name of a property | 140 given instead). This is useful when the name of a property |
| 140 can be numeric. It will only work if the linked item has a | 141 can be numeric. It will only work if the linked item has a |
| 141 key property and is a questionable feature for multilinks. | 142 key property and is a questionable feature for multilinks. |
| 143 The msg_header_property is used in the mail gateway when | |
| 144 sending out messages: By default roundup creates headers of | |
| 145 the form: 'X-Roundup-issue-prop: value' for all properties | |
| 146 prop of issue that have a 'name' property. This definition | |
| 147 allows to override the 'name' property. A common use-case is | |
| 148 adding a mail-header with the assigned_to property to allow | |
| 149 user mail-filtering of issue-emails for which they're | |
| 150 responsible. In that case setting | |
| 151 'msg_header_property="username"' for the assigned_to | |
| 152 property will generated message headers of the form: | |
| 153 'X-Roundup-issue-assigned_to: joe_user'. | |
| 142 """ | 154 """ |
| 143 super(_Pointer, self).__init__(required, default_value) | 155 super(_Pointer, self).__init__(required, default_value) |
| 144 self.classname = classname | 156 self.classname = classname |
| 145 self.do_journal = do_journal == 'yes' | 157 self.do_journal = do_journal == 'yes' |
| 146 self.try_id_parsing = try_id_parsing == 'yes' | 158 self.try_id_parsing = try_id_parsing == 'yes' |
| 159 self.msg_header_property = msg_header_property | |
| 147 def __repr__(self): | 160 def __repr__(self): |
| 148 """more useful for dumps. But beware: This is also used in schema | 161 """more useful for dumps. But beware: This is also used in schema |
| 149 storage in SQL backends! | 162 storage in SQL backends! |
| 150 """ | 163 """ |
| 151 return '<%s.%s to "%s">'%(self.__class__.__module__, | 164 return '<%s.%s to "%s">'%(self.__class__.__module__, |
