Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StateManagerWrapper.group() doesn't include conditional states #221

Open
iambibhas opened this issue Mar 19, 2019 · 2 comments
Open

StateManagerWrapper.group() doesn't include conditional states #221

iambibhas opened this issue Mar 19, 2019 · 2 comments

Comments

@iambibhas
Copy link
Contributor

Ideally it should.

@jace
Copy link
Member

jace commented Mar 20, 2019

IMO, group should accept a list of desired states and test each item against that state. That way states defined in the model don't leak into UI when they're only meant for backend use.

Perhaps you can do this in Funnel as a one-off solution? There is no way to refer to a state object at the moment as Model.state.STATE will return a SQL expression (#181), so it's unclear how group will accept state as a parameter.

Cheap hack you could use for now:

buckets = {}
for proposal in proposal_list:
    for state in ['A', 'B', ...]:
        if getattr(proposal.state, state):
            buckets.setdefault(state, []).append (proposal)

@jace
Copy link
Member

jace commented Jul 29, 2019

This issue is blocked on #181.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants