Merge lp://staging/~sinzui/charmworld/charm-model-cruft into lp://staging/~juju-jitsu/charmworld/trunk

Proposed by Curtis Hovey
Status: Merged
Approved by: Curtis Hovey
Approved revision: 278
Merged at revision: 274
Proposed branch: lp://staging/~sinzui/charmworld/charm-model-cruft
Merge into: lp://staging/~juju-jitsu/charmworld/trunk
Diff against target: 290 lines (+34/-36)
7 files modified
charmworld/models.py (+3/-2)
charmworld/tests/test_models.py (+6/-3)
charmworld/views/api.py (+1/-3)
charmworld/views/charms.py (+7/-8)
charmworld/views/helpers.py (+0/-5)
charmworld/views/tests/test_api.py (+15/-14)
charmworld/views/tests/test_charms.py (+2/-1)
To merge this branch: bzr merge lp://staging/~sinzui/charmworld/charm-model-cruft
Reviewer Review Type Date Requested Status
Richard Harding (community) Approve
Review via email: mp+170151@code.staging.launchpad.net

Commit message

Remove the shims that allowed call sites to pass dicts when Charms are wanted.

Description of the change

Remove the shims that allowed call sites to pass dicts when Charms are wanted.

RULES

    This branch. pre-implementation: abentley
    * Remove the shims that cast a charm data dict to a Charm object
      because all call sites should be passing an object
    * Change Charm.__eq__ to check owner, series, and name because the
      store URL is mutable by promulgated.

    Next Branch:
    This diff shows a lot of casting to get a Charm...json > db > object.
    Maybe we can simplify code by assuming ever case we want a charm from
    the db, we actually want charm objects.
    * Modify factory.makeCharm to return a Charm object?
    * Update find_charm(s) to return Charm objects
    Thoughts?

QA

    * Visit http://staging.jujucharms.com/recently-changed
    * Verify the page loads.
    * Visit http://staging.jujucharms.com/tools/proof-errors
    * View any charm listed on the page.
    * Verify the page loads, it has changes, it has proof errors
    * View a hook file.
    * Return to the charm page.
    * Append /json to the URL
    * Verify the page loads

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) wrote :

Thanks for the update. Please correct the pair of conflicts.

I'm all for getting rid of all the manual casting to Charm(). That seems like something that belongs in the model layer and out of the direct calls to things.

review: Approve
277. By Curtis Hovey

Remove shim from format_proof.

278. By Curtis Hovey

Merged tip and resolves conflicts.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches