title: AttributeError: 'function' object has no attribute 'new'
body: <p>I am developing a project in python and used mongodb as database. I wanted to create a collection by using pymongo, here is what I have done:</p>
  
  <p>First I created mongodb collection object by: </p>
  
  <pre><code>class ReportProblem(Collection):
  collection = db.report_problem
  report_problem = ReportProblem()
  </code></pre>
  
  <p>And in the python code what I did is :</p>
  
  <pre><code>def report_problem():    
     problem_data = dict(
        # Data which needs to be store
  )
  report_problem.new(**problem_data)
  </code></pre>
  
  <p>So I got an error:</p>
  
  <blockquote>
    <p>AttributeError: 'function' object has no attribute 'new'" at line report_problem.new(**problem_data)"</p>
  </blockquote>
  
  <p>Did anybody know why this is happened?</p>