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

How to filter by column != None? #71

Closed
doc-hex opened this issue Jul 27, 2015 · 2 comments
Closed

How to filter by column != None? #71

doc-hex opened this issue Jul 27, 2015 · 2 comments

Comments

@doc-hex
Copy link

doc-hex commented Jul 27, 2015

I have a ManyToOne column, and I'd like to know which rows have a value defined.

In SQLAlchemy, I'd do Model.query.filter(Model.many21 != None), but ROM implemented what in SQLAlchemy would be filter_by using keyword arguments.

I tried doing: Model.query.filter(Model.many21=(0,None)) which gave the right results.

If this type of query is possible, I'd suggest a constant in rom module like "rom.NotNull" or "rom.NotNone" or "rom.IS_DEFINED" and documenting clearly.

@josiahcarlson
Copy link
Owner

I'm calling it rom.NOT_NULL, and I really need to sit down and write a lot of docs for everything. :P

@josiahcarlson
Copy link
Owner

Minus the docs, this is now available in 0.32.2.

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