I am wondering would this make any real efficieny difference (ie computation time, memory etc..)
This is my model:
class FooUser(models.Model):
name = models.CharField(max_length=50)
sirname = models.CharField(max_length=50)
Assume I have 2 different approaches while saving a FooUser at a view: First one, assigning retrieved values to a variable and pass it to the object after that.
#say I retrieve name and sirname from users cookie.(lets not care for the exceptions for now.
input_name =request.session['name']
input_sirname =request.session['sirname']
FooUser(name=input_name,sirname=input_sirname).save()
Second one, directly passing as parameter:
#say I retrieve name and sirname from users cookie.(lets not care for the exceptions for now.
FooUser(name=request.session['name'],sirname=request.session['sirname']).save()
I know this question can be a little stupid but for long inputs, passing these inputs to the object makes the code almost unreadable :)