Hi there,
I have a model that holds user address. This model has to have first_name and last_name fields since one would like to set address to a recipient (like his company etc.). What I'm trying to achieve is:
- if the fist_name/last_name field in the address is filled - return simply that field
- if the fist_name/last_name field in the address is empty - fetch corrresponding field data from a foreignkey pointing to a proper django.auth.models.User
- I'd like this to be treated as normal django field that would be present in fields lookup
- I don't want to create a method, since it's a refactoring and Address.first_name/last_name are used in various places of the application (also in model forms etc.), so I need this to me as smooth as possible or else I'll have to tinker around in a lot of places
Thanks for help :)