{"action":"created","issue":{"url":"https://api.github.com/repos/kmmbvnr/django-fsm/issues/90","labels_url":"https://api.github.com/repos/kmmbvnr/django-fsm/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/kmmbvnr/django-fsm/issues/90/comments","events_url":"https://api.github.com/repos/kmmbvnr/django-fsm/issues/90/events","html_url":"https://github.com/kmmbvnr/django-fsm/issues/90","id":88375451,"number":90,"title":"conditions do not work with boolean properties","user":{"login":"karyon","id":1891915,"avatar_url":"https://avatars.githubusercontent.com/u/1891915?v=3","gravatar_id":"","url":"https://api.github.com/users/karyon","html_url":"https://github.com/karyon","followers_url":"https://api.github.com/users/karyon/followers","following_url":"https://api.github.com/users/karyon/following{/other_user}","gists_url":"https://api.github.com/users/karyon/gists{/gist_id}","starred_url":"https://api.github.com/users/karyon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karyon/subscriptions","organizations_url":"https://api.github.com/users/karyon/orgs","repos_url":"https://api.github.com/users/karyon/repos","events_url":"https://api.github.com/users/karyon/events{/privacy}","received_events_url":"https://api.github.com/users/karyon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-15T09:52:10Z","updated_at":"2015-06-18T01:06:44Z","closed_at":"2015-06-18T01:06:44Z","body":"the `conditions` parameter currently must be a list of callables, that take a model instance as argument.\r\n\r\nsuppose the model has a boolean property, called `is_happy`. to make `is_happy` a condition for some transition, i would have to write some method `is_happy_func(self): return self.is_happy` or put some lambda into the conditions, which doesn't look cool.\r\n\r\nthe same problem arises when the model has a lot of functions that are `@property`s, e.g. because the project guidelines say that all methods that begin with `is_`, `has_` or `can_` should be properties (like in my case).\r\n\r\nin case the current syntax does not work: one approach would be to allow strings in the conditions list that are used to \"look up\" properties on the model instance. that might be a bit weird at first sight but django uses such string parameters extensively e.g. in the QuerySet API, so django-fsm users should be familiar with that."},"comment":{"url":"https://api.github.com/repos/kmmbvnr/django-fsm/issues/comments/112998750","html_url":"https://github.com/kmmbvnr/django-fsm/issues/90#issuecomment-112998750","issue_url":"https://api.github.com/repos/kmmbvnr/django-fsm/issues/90","id":112998750,"user":{"login":"kmmbvnr","id":282529,"avatar_url":"https://avatars.githubusercontent.com/u/282529?v=3","gravatar_id":"","url":"https://api.github.com/users/kmmbvnr","html_url":"https://github.com/kmmbvnr","followers_url":"https://api.github.com/users/kmmbvnr/followers","following_url":"https://api.github.com/users/kmmbvnr/following{/other_user}","gists_url":"https://api.github.com/users/kmmbvnr/gists{/gist_id}","starred_url":"https://api.github.com/users/kmmbvnr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmmbvnr/subscriptions","organizations_url":"https://api.github.com/users/kmmbvnr/orgs","repos_url":"https://api.github.com/users/kmmbvnr/repos","events_url":"https://api.github.com/users/kmmbvnr/events{/privacy}","received_events_url":"https://api.github.com/users/kmmbvnr/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T01:06:44Z","updated_at":"2015-06-18T01:06:44Z","body":"The core problem of strings is that the single function parameter became accepts 2 types of arguments - strings and lambdas.\r\n\r\nI don't like to introduce such ambiguity. And it can't be considered as django way, b/c django use strings on consistent maneur and only for field references, not for properties or methods."}}