Skip to content

TypeError: unsupported operand type(s) for |: 'AnyChange' and 'Q' #226

Description

@adk-swisstopo

I am trying to compose a pgtrigger.AnyChange with a pgtrigger.Q like this:

class MyTrigger(pgtrigger.Trigger):
  # ...

MyTrigger(
  # ...
  condition=(
    pgtrigger.AnyChange('some_field') |
    ~pgtrigger.Q(old__geometry__poly__equals=pgtrigger.F('new__geometry')))

This fails like this:

TypeError: unsupported operand type(s) for |: 'AnyChange' and 'Q'

I tried to understand what makes the two types incompatible but could not figure it out. Is there a way to build a condition with a combination of AnyChange and Q? If not, would that make sense as a feature request? If yes, any guidance on how to go about it would be welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions