heroku/heroku.py — pull request #7 by ojii (2012-04-11 14:18:45+00:00)
Title: Allow adding domains to an app that does not have domains yet.

Currently, trying to ``cloud.apps[0].domains.add('mydomain.com')`` does not work if ``cloud.apps[0]`` does not have domains yet, as in this case the ``app`` keyword to ``heroku.api.HerokuCore._get_resources`` from ``heroku.models.App.domains`` is lost. This patch stores the keyword arguments passed to ``_get_resources`` on the ``KeyedListResource`` and uses it in its ``add`` method to update ``o.__dict__`` in case the list is empty.