Automatically set hidden field for model object id