Is there a way to avoid “Unused variable” warning on get_or_create method?
level,created= Level.objects.get_or_create( name='Alumnes x Classificar')
because I don’t need to read created variable, IDE show a warning about this.
I know that a trivial solutions i to use variable, some thing like: if create: pass
But I’m looking for a more elegant solution.
See you!
One “standard” way of doing this is to use the
_variable:_is a “real variable” (insomuch as you can read from and write to it), but it’s generally understood to mean “ignored”.