Feature request #10539

QgsExpression instance variables

Added by Nathan Woodrow about 3 years ago. Updated almost 2 years ago.

Status:Closed
Priority:Normal
Assignee:Nyall Dawson
Category:Expressions
Pull Request or Patch supplied:No Resolution:fixed/implemented
Easy fix?:No

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

History

#1 Updated by Nathan Woodrow about 2 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 almost 2 years ago

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

Implemented in master

Also available in: Atom PDF