Feature request #10539

QgsExpression instance variables

Added by Nathan Woodrow almost 10 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:Nyall Dawson
Category:Expressions
Pull Request or Patch supplied:No Resolution:fixed/implemented
Easy fix?:No Copied to github as #:18947

Description

It would be handy to have replace variable in QgsExpression like we have normally in SQL type engines. For example:


exp = QgsExpression('"person" = @name')
exp.bind('name', "Woo")

This would change the expression to be:


'"person" = 'Woo''

The difference is these are added at parse time not on evaluate.

A more simple Python API could be:


exp = QgsExpression('"person" = @name', name="Woo")


Related issues

Related to QGIS Application - Feature request #9546: Expression Contexts Closed 2014-02-12

History

#1 Updated by Nathan Woodrow almost 9 years ago

  • Assignee changed from Nathan Woodrow to Nyall Dawson

Nyall feel free to close if you already have a ticket for this for your current work.

#2 Updated by Nyall Dawson over 8 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Implemented in master

Also available in: Atom PDF