Fix populating extension settings forms from defaults.

Review Request #5805 — Created May 12, 2014 and submitted

Information

Djblets
master
56b2f17...

Reviewers

The move to SiteSettingsForm broke extension configuration pages
slightly. They accessed the settings object using settings.get(key), and
not through settings[key], which prevented any defaults from being
fetched.

There's now a get() function that works just like attribute access,
returning defaults, but with the semantics of the standard dict.get()
call. This complements set().

Unit test passed.

Loaded an extension config form with a blank settings dictionary and
saw the defaults used, instead of blank fields.

Description From Last Updated

Can you add comments for why these methods are required?

daviddavid
david
  1. 
      
  2. djblets/extensions/settings.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
    Show all issues

    Can you add comments for why these methods are required?

    1. Sure. set() isn't part of dict, though.

  3. 
      
chipx86
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (cfc934a)
Loading...