How to nest conjunctions or_ and and_ in SQLAlchamey

user3745855

I'm tyring to recreate this query in SQL Alchamey but I've been unable to nest the filters:

Query:

SELECT * FROM calendar 
where (recurrenceRule = '') 
or (recurrenceRule != '' and start < @end1);

Python:

events.filter(or_(Calendar.recurrenceRule!='',
      (Calendar.recurrenceRule=='',Calendar.start>=filterStart))

This python results in the following exception: "SQL expression object or string expected."

van

You must use and_ explicitly:

events.filter(or_(
    Calendar.recurrenceRule!='',
    and_(Calendar.recurrenceRule=='', Calendar.start>=filterStart))
)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Regex to check words in string are separated only by spaces and not by _AND_/_OR_ python

From Dev

How to use conditional operator or_ in sqlalchemy with conditional if?

From Java

How to extract noun and adjective pairs including conjunctions

From Dev

How to localize or string format a list of words with commas and conjunctions in C#?

From Dev

How to localize or string format a list of words with commas and conjunctions in C#?

From Dev

How to write multiple component nested conjunctions constraints in SQLAlchemy

From Dev

How to sort pandas columns based on letter _and_ number?

From Dev

How to create an iterator from string _and_ store it in a struct?

From Dev

How to grep a specific line _and_ the first line of a file?

From Dev

How to rename React components _and_ have the 'imports' refactored too?

From Dev

SQLALCHEMY or_ list comprehension

From Dev

How do I remove verbs, prepositions, conjunctions etc from my text?

From Dev

How do I remove verbs, prepositions, conjunctions etc from my text?

From Dev

How do I configure sshd to 1) require public key _and_ 2) require a password for login?

From Dev

How to nest LabelKFold?

From Dev

How to nest monads

From Dev

How to to nest a sequence with Q?

From Dev

How to nest numba jitclass

From Dev

How to nest IF, AND, OR in excel

From Dev

How to nest sed substitutions?

From Dev

how to nest structured filtered queries?

From Dev

How to nest expressions in AngularJS' views?

From Dev

Java: How to nest JPanel in a GridLayout?

From Dev

How to nest two routes in Ember?

From Dev

Polymer 1.0: How to nest functions?

From Java

How to nest a "for loop" n times?

From Dev

How to nest multiple parfor loops

From Dev

How do I nest this for loop?

From Dev

How to nest modules in Android Studio

Related Related

  1. 1

    Regex to check words in string are separated only by spaces and not by _AND_/_OR_ python

  2. 2

    How to use conditional operator or_ in sqlalchemy with conditional if?

  3. 3

    How to extract noun and adjective pairs including conjunctions

  4. 4

    How to localize or string format a list of words with commas and conjunctions in C#?

  5. 5

    How to localize or string format a list of words with commas and conjunctions in C#?

  6. 6

    How to write multiple component nested conjunctions constraints in SQLAlchemy

  7. 7

    How to sort pandas columns based on letter _and_ number?

  8. 8

    How to create an iterator from string _and_ store it in a struct?

  9. 9

    How to grep a specific line _and_ the first line of a file?

  10. 10

    How to rename React components _and_ have the 'imports' refactored too?

  11. 11

    SQLALCHEMY or_ list comprehension

  12. 12

    How do I remove verbs, prepositions, conjunctions etc from my text?

  13. 13

    How do I remove verbs, prepositions, conjunctions etc from my text?

  14. 14

    How do I configure sshd to 1) require public key _and_ 2) require a password for login?

  15. 15

    How to nest LabelKFold?

  16. 16

    How to nest monads

  17. 17

    How to to nest a sequence with Q?

  18. 18

    How to nest numba jitclass

  19. 19

    How to nest IF, AND, OR in excel

  20. 20

    How to nest sed substitutions?

  21. 21

    how to nest structured filtered queries?

  22. 22

    How to nest expressions in AngularJS' views?

  23. 23

    Java: How to nest JPanel in a GridLayout?

  24. 24

    How to nest two routes in Ember?

  25. 25

    Polymer 1.0: How to nest functions?

  26. 26

    How to nest a "for loop" n times?

  27. 27

    How to nest multiple parfor loops

  28. 28

    How do I nest this for loop?

  29. 29

    How to nest modules in Android Studio

HotTag

Archive