# Takes model and fieldname and sets field to current datetime on pre_save
def auto_now_on_save(model, fieldname):
	from django.db.models import signals
	from django.dispatch import dispatcher
	def _update_datefield(instance):
		from datetime import datetime
		setattr(instance, fieldname, datetime.now())
	dispatcher.connect(_update_datefield, signal=signals.pre_save, sender=model, weak=False)