Fix counter defaults on new model instances.

Review Request #2581 — Created Sept. 7, 2011 and submitted

Information

Djblets
master

Reviewers

Fix counter defaults on new model instances.

On new models, counters were being initialized to 0, since the model didn't
have a primary key set yet. This meant that we skipped any sort of calculations,
resulting in counters simply being broken.

Now we refuse to set a default, keeping it NULL, if it's a new model. The next
load should then perform a proper calculation.
Tested with an accompanying Review Board change. Test passes.
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed