[WIP] Allow the user to have custom ways to set attributes

This is just a proof of concept for #285. Provided that this solves @dimrsilva's issue, and @scottrobertson is ok with this, I'll add tests and update the documentation.