Mercurial > p > roundup > code
comparison roundup/configuration.py @ 4887:05c857e5dbed
New rdbms configuration option 'isolation_level'
See discussion in http://issues.roundup-tracker.org/issue2550806
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Sun, 06 Apr 2014 11:11:04 +0200 |
| parents | 6018617c55ab |
| children | 5251e97b1de0 |
comparison
equal
deleted
inserted
replaced
| 4886:a116de39e38c | 4887:05c857e5dbed |
|---|---|
| 290 _val = value.lower() | 290 _val = value.lower() |
| 291 if _val in ("yes", "no", "new"): | 291 if _val in ("yes", "no", "new"): |
| 292 return _val | 292 return _val |
| 293 else: | 293 else: |
| 294 raise OptionValueError(self, value, self.class_description) | 294 raise OptionValueError(self, value, self.class_description) |
| 295 | |
| 296 class IsolationOption(Option): | |
| 297 """Database isolation levels""" | |
| 298 | |
| 299 allowed = ['read uncommitted', 'read committed', 'repeatable read', | |
| 300 'serializable'] | |
| 301 class_description = "Allowed values: %s" % ', '.join ("'%s'" % a | |
| 302 for a in allowed) | |
| 303 | |
| 304 def str2value(self, value): | |
| 305 _val = value.lower() | |
| 306 if _val in self.allowed: | |
| 307 return _val | |
| 308 raise OptionValueError(self, value, self.class_description) | |
| 295 | 309 |
| 296 class MailAddressOption(Option): | 310 class MailAddressOption(Option): |
| 297 | 311 |
| 298 """Email address | 312 """Email address |
| 299 | 313 |
| 648 " the template database (SQL_ASCII)\n" | 662 " the template database (SQL_ASCII)\n" |
| 649 " HINT: Use the same encoding as in the template database,\n" | 663 " HINT: Use the same encoding as in the template database,\n" |
| 650 " or use template0 as template.\n" | 664 " or use template0 as template.\n" |
| 651 "then set this option to the template name given in the\n" | 665 "then set this option to the template name given in the\n" |
| 652 "error message."), | 666 "error message."), |
| 667 (IsolationOption, 'isolation_level', 'read committed', | |
| 668 "Database isolation level, currently supported for\n" | |
| 669 "PostgreSQL and mysql. See, e.g.,\n" | |
| 670 "http://www.postgresql.org/docs/9.1/static/transaction-iso.html"), | |
| 653 ), "Settings in this section are used" | 671 ), "Settings in this section are used" |
| 654 " by RDBMS backends only" | 672 " by RDBMS backends only" |
| 655 ), | 673 ), |
| 656 ("logging", ( | 674 ("logging", ( |
| 657 (FilePathOption, "config", "", | 675 (FilePathOption, "config", "", |
