Feature request #10539

QgsExpression instance variables

Added by Nathan Woodrow almost 3 years ago. Updated over 1 year ago.

Status:Closed Start Date:06/10/2014
Priority:Normal Due date:
Assigned to:Nyall Dawson % Done:


Target version:Future Release - Nice to have
Platform: Resolution:fixed/implemented
Platform version: Pull Request or Patch supplied:No
Status info: Tag:


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 02/12/2014


Updated by Nathan Woodrow almost 2 years ago

  • Assigned to changed from Nathan Woodrow to Nyall Dawson

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

Updated by Nyall Dawson over 1 year ago

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

Implemented in master

Also available in: Atom