title: django Inheriting from helper class
body: <p>I wanted to make wallets for BTC and LTC coins in my models. But since most of the code will be same apart from the <code>coin_name</code> and <code>tx_fees</code>. <br>
  So, I thought of making a helper class like this : <br></p>
  
  <p><strong>Wallet class</strong> ( snippet )</p>
  
  <pre><code>class Wallet(models.Model):
      name = models.CharField(max_length=80, editable=False)
      trading_amt = models.FloatField(default=0, validators=[MinValueValidator(0.0), ])
      wallet_amt = models.FloatField(default=0, validators=[MinValueValidator(0.0), ])
      wallet_address = models.CharField(default='', blank=True, max_length=100)
      coin_name = ''  &lt;-- will it serve the purpose ?
      tx_fee = 0      &lt;-- and this ?
  
      def __init__(self, coin_name, tx_fee):
          self.coin_name = coin_name
          self.tx_fee = tx_fee
  
      @transaction.atomic
      def moveToTrading(self, amount):
          if amount &gt; self.wallet_amt:
              return "Insufficient balance"
          else:
              self.trading_amt += amount
              self.wallet_amt -= amount
              return True
  
      @transaction.atomic
      def withdraw(self, amount, withdrawal_wallet_addr):
          if amount &gt; self.wallet_amt:
              return "Insufficient balance"
          else:
              # First check if withdrawal address entered by user is
              # correct, using wallet daemon , if not return error
              if check_wallet(withdrawal_wallet_addr, "btc"):
                  # initiate checkout
                  return initiate_checkout(withdrawal_wallet_addr, self.coin_name, self.tx_fee)
              else:
                  return "Incorrect Wallet address"
  
      def save(self, *args, **kwargs):
          self.name = gen_random_string('btc_wallet')
          super(Wallet, self).save(*args, **kwargs)
  
      def deposit(self, amount):
          self.wallet_amt += amount
  
      def __unicode__(self):
          return self.name
  
      def __str__(self):
          return self.name
  </code></pre>
  
  <p>The use of <code>coin_name</code> is only while creating wallet address <code>name</code> like this : _btc_wallet_&lt;64 char random string>_<br>
  And <code>tx_fee</code> is stored as a constant in <strong>helpers.py</strong> for each coin.<br>
  So, saving these in the database doesn't makes sense.</p>
  
  <h2>Problem 1 :</h2>
  
  <p>I am a little noob in OOP programming ( I know what these are , but haven't coded much ) so am confused as to what would be it's correct usage :</p>
  
  <h3>Usage 1 :</h3>
  
  <pre><code>class BtcWallet(Wallet):
      def __init__(self, coin_name, tx_fee):
          self.tx_fee = BTC_FEES
          self.coin_name = "BTC"
          super(BtcWallet, self).__init__(coin_name, tx_fee)
  </code></pre>
  
  <h3>OR</h3>
  
  <pre><code>class BtcWallet(Wallet):
      def __init__(self, coin_name, tx_fee):
          self.tx_fee = BTC_FEES
          self.coin_name = "BTC"
  </code></pre>
  
  <p>i.e. do I need to initialise the <strong>super initialiser</strong> ?</p>
  
  <p>Also if super is used then how should it be used, like :</p>
  
  <pre><code>super(BtcWallet, self).__init__(coin_name, tx_fee)
  </code></pre>
  
  <p><strong>or</strong></p>
  
  <pre><code>super(Wallet, self).__init__(coin_name, tx_fee)
  </code></pre>
  
  <h2>Problem 2 :</h2>
  
  <p>Since <code>coin_name</code> and <code>tx_fees</code> isn't saved in the database, so when could it fail ? Like when would it not take the values.</p>
  
  <p>Perhaps, it shouldn't fail cause always there would be an object of this wherever it would be used ?</p>
  
  <p>The <code>BtcWallet</code> is a foreign key element of <strong>userprofile</strong> model.would it fail if I use it like this
   <code>request.user.profile.BTC_wallet.withdraw()</code><br>
  ( I may use it in one of the views )</p>
  
  <p><strong>UserProfile model</strong>  ( snippet )</p>
  
  <pre><code>class UserProfile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
      joining_date = models.DateTimeField(default=timezone.now)
      BTC_wallet = models.OneToOneField(BtcWallet, on_delete=models.SET_NULL, related_name='profile', null=True,
                                        blank=True)
  </code></pre>
  
  <h2>Update :</h2>
  
  <p>After changing to new form ( earlier there wasn't any wallet class in my code and the wallet class was the BtcWallet class ) and making migrations results into this :</p>
  
  <pre><code>jame@vostro:~/mywebsite# python manage.py makemigrations account
  You are trying to add a non-nullable field 'wallet_ptr' to btcwallet without a default; we can't do that (the database needs something to populate existing rows).
  Please select a fix:
   1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
   2) Quit, and let me add a default in models.py
  Select an option: 
  </code></pre>