Added option to automatically define attributes from main_model when using proxy