I'm very new to python and (coming from Java) am trying to think in a "pythonic" way. I'm having trouble understanding how Django turns a function (or variable) name given in string to the actual function.
Example from Django tutorial: If we give:
list_display = ('question', 'pub_date', 'was_published_recently')
Django reads the function and some related properties from the code:
def was_published_recently(self): return self.pub_date >= timezone.now() - datetime.timedelta(days=1) was_published_recently.admin_order_field = 'pub_date' was_published_recently.boolean = True was_published_recently.short_description = 'Published recently?'
So, my question: How does the string get turned into the actual function name?