I have a basic question on python functions and parameters
Given this function:
def findArticleWithAttr(tableattrib, user_url_input):
articles = Something.objects.filter(tableattrib=user_url_input)
I call the function with:
findArticleWithAttr(attribute1, userinput1)
tableattrib is not set by findArticleWithAttr attribute1 and just takes the latter (userinput1) parameter and replaces it.
How can i make python set both parameters in the equation?
Something.objects.filter(tableattrib=user_url_input)doesn't seem correct. What you're doing in there is passinguser_url_inputto an argument calledtableattribfor the method.filter. Not sure, but I think that's not what you want... Also, what's this? Django?findArticleWithAttr. Obviously this doesn't work, astableattribis treated as a keyword identifier rather than a variable identifier in this syntax.