#10130 closed (fixed)
Support setting deletion
Reported by: | Joost Cassee | Owned by: | Joost Cassee |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | settings | |
Cc: | Ben Spaulding | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The LazySettings
class supports setting and getting options, but not deleting them. Apart from the obvious symmetry, the very useful TestSettingsManager
class from this snippet (which changes settings temporarily for tests) requires it.
The attached patch adds a __delattr__
method. Please consider applying it.
Attachments (3)
Change History (17)
by , 16 years ago
Attachment: | 10130-r9791.diff added |
---|
follow-up: 2 comment:1 by , 16 years ago
comment:2 by , 16 years ago
Replying to dc:
You shouldn't alter settings in your applications at runtime.
I agree -- in theory. In practice I have an application of which the behaviour is dependent on settings, that I want to test.
comment:3 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 16 years ago
milestone: | 1.1 → 1.2 |
---|
comment:6 by , 16 years ago
Needs tests: | unset |
---|
Apparently a recent change broke the attached patch. The new one includes a trivial patch.
by , 16 years ago
Attachment: | 10130-r10407.diff added |
---|
comment:7 by , 15 years ago
Patch needs improvement: | set |
---|
Should test the '_wrapped'
special case too - and I'd suggest that it should be raising AttributeError
.
by , 15 years ago
Attachment: | 10130-r11594.diff added |
---|
Remember to also add init.py and models.py to test directory.
comment:8 by , 15 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | unset |
Updated patch following SmileyChris' suggestions.
comment:9 by , 15 years ago
Needs tests: | unset |
---|---|
Owner: | changed from | to
comment:10 by , 15 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:11 by , 15 years ago
Cc: | added |
---|
comment:12 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
http://docs.djangoproject.com/en/dev/topics/settings/#altering-settings-at-runtime