Objects can be thought of as juiced up dictionaries. In fact, they have a dict. So try this:
days = ['mon','tues','weds','thurs','fri','sat','sun']
for day in days:
form.__dict__[day + '_start'] = #some datetime setting
form.__dict__[day + '_end'] = #some datetime setting
And you'll get what you want. But its a bit hackish.
The function setattr(, ) does the same thing, its just an explicit (non-hackish) way of doing this, and it should be supported in the future regardless whatever winds up happening to the dict:
days = ['mon','tues','weds','thurs','fri','sat','sun']
for day in days:
for mark in [('start', gen_start_func), ('end', gen_end_func)]:
setattr(form, '_'.join([day, mark[0]]), mark[1]())
So in the last version we're using setattr() and we're using an inner loop that operates over a tuple containing (, ). Its a different way of doing things which may or may not be more readable, depending on the problem you're trying to solve and the type of code you are used to reading.