title: Why does this return a " Typeerror: __init__() got a unexpected keyword argument "comment_num" " when run
body: <pre><code>class Blog(object):
      def __init__(self, author, description, author_id, _id=None):
          self.author = author
          self.author_id = author_id
          self.description = description
          self._id = uuid.uuid4().hex if _id is None else _id
          self.comment_num = Database.count('posts', {'blog_id': _id})
  </code></pre>
  
  <p>This is the Blog object. When I run the Flask Application it returns the error. saying it is an internal server error. What could be the cause? self.comment_num is supposed to return the number of posts the Blog has based on the Blog id from the collection posts.</p>
  
  <p>JSON code</p>
  
  <pre><code>def json(self):
      return {
          'author': self.author,
          'author_id': self.author_id,
          'description': self.description,
          'comment_num': self.comment_num,
          '_id': self._id
      }
  </code></pre>
  
  <p>DATABASE CODE</p>
  
  <pre><code>@staticmethod
  def count(collection, query):
      Database.DATABASE[collection].count(query)
  </code></pre>
  
  <p>I have currently deployed the application to heroku and the logs show:</p>
  
  <p><img src="https://i.stack.imgur.com/DAovi.png" alt=""></p>
  
  <p>If there is another more efficient way to merely display a the number of posts that a blog has by finding it in the database by blog id, please help me to use that solution.
  Thank You </p>