title: Convert timedelta value to float
body: <p>I need to save a <code>timedelta</code> value into a float type fields.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>if self.end_time and self.start_time:
          timediff =self.end_time - self.start_time // Here i get a time.delta value
          self.duration = // here i get an error
  </code></pre>
  
  <p></p>
  
  <pre><code>TypeError: float() argument must be a string or a number, not
  'datetime.timedelta'
  </code></pre>
  
  <p>How can I resolve this?</p>