title: Appengine - Reportlab (Get Photo from Model)
body: <p>I´m using Reportlab to generate a PDF. 
  Can´t retrieve a photo from a model. </p>
  
  <pre><code>#Personal Info             
    p.drawImage('myPhoto.jpg', 40, 730)
    p.drawString(50, 670, 'Your name:' + '%s' % user.name)
    p.drawImage (50, 640, 'Photo: %s' % (user.photo))
  </code></pre>
  
  <p>When i create on generate PDF, i got this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 513, in __call__
      handler.post(*groups)
    File "C:\Users\hp\workspace\myApp\src\main.py", line 419, in post
      p.drawImage (50, 640, 'Photo: %s'  %                  (user.photo))
    File "reportlab.zip\reportlab\pdfgen\canvas.py", line 825, in drawImage
    File "reportlab.zip\reportlab\pdfbase\pdfdoc.py", line 2076, in __init__
    File "C:\Python25\lib\ntpath.py", line 189, in splitext
      i = p.rfind('.')
  AttributeError: 'int' object has no attribute 'rfind'
  </code></pre>
  
  <p>If i comment the line which n.º 419, that calls the photo, everything goes fine.
  I´ve already inspected in Datastore Viewer and the models are ok.</p>
  
  <p>Can someone point out what´s going wrong?</p>
  
  <p>Should i use %s instead of str? But throws same error. </p>