Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all attributes in a single transaction #6142

Merged
merged 4 commits into from
Jan 29, 2018

Conversation

pblottiere
Copy link
Member

@pblottiere pblottiere commented Jan 23, 2018

Description

Update all attributes in one transaction in order to correctly check database constraints.

Fixes https://issues.qgis.org/issues/17869

Checklist

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and containt sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit

Copy link
Collaborator

@nyalldawson nyalldawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a test for this one?

*
* \since QGIS 3.0
*/
bool changeAttributeValues( QgsFeatureId fid, const QgsAttributeMap &newValues, const QgsAttributeMap &oldValues = QgsAttributeMap(), bool skeipDefaultValues = false );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"skeip" -> skip

* request to the underlying data provider, so it is more efficient to
* explicitly pass an oldValue if it is already available.
*
* If \a skipDefaultValue is set to true, default field values will not
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skipDefaultValues

@nyalldawson
Copy link
Collaborator

Oops, missed your test coming soon message :)

@pblottiere
Copy link
Member Author

@nyalldawson Thank you for your review!

I updated the documentation and added some tests. Waiting for Travis now...

@pblottiere
Copy link
Member Author

I'll merge this PR tomorrow if I have no objections in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants