{"action":"created","issue":{"url":"https://api.github.com/repos/pydanny/dj-stripe/issues/201","labels_url":"https://api.github.com/repos/pydanny/dj-stripe/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/pydanny/dj-stripe/issues/201/comments","events_url":"https://api.github.com/repos/pydanny/dj-stripe/issues/201/events","html_url":"https://github.com/pydanny/dj-stripe/issues/201","id":86334411,"number":201,"title":"Support membership levels","user":{"login":"chrissmejia","id":3825991,"avatar_url":"https://avatars.githubusercontent.com/u/3825991?v=3","gravatar_id":"","url":"https://api.github.com/users/chrissmejia","html_url":"https://github.com/chrissmejia","followers_url":"https://api.github.com/users/chrissmejia/followers","following_url":"https://api.github.com/users/chrissmejia/following{/other_user}","gists_url":"https://api.github.com/users/chrissmejia/gists{/gist_id}","starred_url":"https://api.github.com/users/chrissmejia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrissmejia/subscriptions","organizations_url":"https://api.github.com/users/chrissmejia/orgs","repos_url":"https://api.github.com/users/chrissmejia/repos","events_url":"https://api.github.com/users/chrissmejia/events{/privacy}","received_events_url":"https://api.github.com/users/chrissmejia/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydanny/dj-stripe/labels/feature","name":"feature","color":"009800"},{"url":"https://api.github.com/repos/pydanny/dj-stripe/labels/proposal","name":"proposal","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-08T21:18:19Z","updated_at":"2015-06-09T00:13:34Z","closed_at":null,"body":"Right now you have something like:\r\n\r\nDJSTRIPE_PLANS = {\r\n    \"bronze-monthly\": {\r\n    ...\r\n    },\r\n    \"bronze-yearly\": {\r\n    ....\r\n    },\r\n    \"silver-monthly\": {\r\n    ....\r\n    },\r\n    \"silver-yearly\": {\r\n    ....\r\n    },\r\n    \"gold-monthly\": {\r\n    ....\r\n    },\r\n    \"gold-yearly\": {\r\n    ....\r\n    }\r\n}\r\n\r\nAnd that works but when you go to the change plans page, you get something like this:\r\n\r\n{% elif customer.current_subscription.amount < plan.price|djdiv:100 %}\r\n\r\nAnd that's don't work obviously because  silver-monthly is cheaper than bronze-yearly but the change is a downgrade not an upgrade, then I propose an 2 level hierarchy like this:\r\n\r\n DJSTRIPE_PLANS = {\r\n    \"bronze\": {\r\n        \"monthly\": {\r\n         ....\r\n        },\r\n        \"yearly\": {\r\n         ....\r\n        },\r\n    },\r\n    \"silver\": {\r\n    ....\r\n    },\r\n\r\nor some:\r\n\r\nDJSTRIPE_HIERARCHY_PLANS = {\r\n \"bronze\": {\r\n    \"weight\": 0\r\n    \"plans\": {\r\n        \"bronze-monthly\",\r\n        \"bronze-yearly\"\r\n    }\r\n  },\r\n\"silver\" {\r\n    \"weight\": 1\r\n    \"plans\": {\r\n        ....\r\n    }\r\n}\r\n\r\nand then make some comparison like: \r\n\r\n{% elif customer.current_subscription.weight < plan.weight %}\r\n\r\nWhat do you guys think about this?"},"comment":{"url":"https://api.github.com/repos/pydanny/dj-stripe/issues/comments/110178960","html_url":"https://github.com/pydanny/dj-stripe/issues/201#issuecomment-110178960","issue_url":"https://api.github.com/repos/pydanny/dj-stripe/issues/201","id":110178960,"user":{"login":"kavdev","id":4859329,"avatar_url":"https://avatars.githubusercontent.com/u/4859329?v=3","gravatar_id":"","url":"https://api.github.com/users/kavdev","html_url":"https://github.com/kavdev","followers_url":"https://api.github.com/users/kavdev/followers","following_url":"https://api.github.com/users/kavdev/following{/other_user}","gists_url":"https://api.github.com/users/kavdev/gists{/gist_id}","starred_url":"https://api.github.com/users/kavdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavdev/subscriptions","organizations_url":"https://api.github.com/users/kavdev/orgs","repos_url":"https://api.github.com/users/kavdev/repos","events_url":"https://api.github.com/users/kavdev/events{/privacy}","received_events_url":"https://api.github.com/users/kavdev/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T00:13:34Z","updated_at":"2015-06-09T00:13:34Z","body":"That seems to work quite well, and doesn't seem to conflict with anything else. Submit a pull request and I'll move forward on this."}}