Bug report #18130
Using uuid generator function in field calculator return the same value for each feature
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Field calculator | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 26023 |
Description
It seems to me that the correct behaviour here is to compute a distinct uuid for each feature.
A work around is to define a custom function like this
@from qgis.core import *
from qgis.gui import *
import uuid
@qgsfunction(args='auto', group='Custom')
def getUUID(feature, parent):
return '{' + str(uuid.uuid4()) + '}'@
Associated revisions
Fix uuid() function returns the same uuid
Fixes #18130
History
#1 Updated by Nyall Dawson almost 7 years ago
- % Done changed from 0 to 100
- Status changed from Open to Closed
Applied in changeset qgis|605ea376df3be6ca57e4917cae62e2d66bdbef93.
#2 Updated by Giovanni Manghi almost 7 years ago
- Resolution set to fixed/implemented