title: AtributteError "object has no attribute" - how to prevent without try/except - accessing model field
body: <p>I have a question:
  (I'm working on Django 1.8, Python 2.7.15)
  I'm getting an object from the database:</p>
  
  <pre><code>shop_users = ShopUsers.objects.get(pk=_id)
  </code></pre>
  
  <p>Then if the object exists I am preparing data for View:</p>
  
  <pre><code>if shop_users:
      data = {
          'full_name': shop_users.full_name,
          'shop': shop_users.shop.title,
          'price_title': shop_users.price.title if shop_users.price.title else '',
          'package_price': shop_users.price.price,
          'user_price': shop_users.payment.operation_amount
      }
  </code></pre>
  
  <p>But there is a possibility that shop_users.price.title won't exist.</p>
  
  <p>I would like to check it right while I prepare data like above (I'm doing '... if ... else'), but if shop_users.price.title does not exist it provides AttributeError.</p>
  
  <p>I can use try/except before 'data' declaration but this will double my code...</p>
  
  <p>Is there any trick for handling AttributeError with (... if ... else)?</p>
  
  <p>Maybe shop_users.price.title[0] (does not work)</p>
  
  <p>or get(shop_users.price.title) ? </p>
  
  <p>I just don't want to double my code... but I don't know any trick for this :/</p>
  
  <p>I'm junior. I appreciate any help! </p>