def user_field(user, field, *args):
 if (field and hasattr(user, field)):
  if args:
   v = args[0]
   if v:
    User = get_user_model()
    v = v[0:User._meta.get_field(field).max_length]
   setattr(user, field, v)
  else:
   return getattr(user, field)

def user_field ( user , field , * args ) : if ( field and hasattr ( user , field ) ) : if args : v = args [ 0 ] if v : User = get_user_model ( ) v = v [ 0 : User . _meta . get_field ( field ) . max_length ] setattr ( user , field , v ) else : return getattr ( user , field )
gets or sets user model fields .