<div dir="ltr">Oh yes, and here is what the call to the API returns:<div><br></div><div><table><tbody><tr><td class="" value="1"></td><td class="">{"adult":false,"also_known_as":["George Walton Lucas Jr. "],"biography":"Arguably the most important film innovator in the history of the medium, George Lucas continually \"pushed the envelope\" of filmmaking technology since his early days as a student at U.S.C. Considered a wunderkind by his contemporaries, he had a much harder time communicating his vision to studio executives, whose meddling managed to compromise each of his first three feature directing efforts in some way. The monumental success of \"Star Wars\" (1977) ushered in the era of the \"summer blockbuster,\" which, despite the later popularity of low budget independent films, was still the prevailing mentality powering the Hollywood engine.\n\nThough he set the tone and established the expectations which influenced studios to devote the bulk of their resources to films designed to blast off into hyperspace for spectacular profits, it was doubtful that a film as revolutionary as \"Star Wars\" was in its day could get made in the later blockbuster assembly line climate of the new millennium.","birthday":"1944-05-14","deathday":"","homepage":"","id":1,"imdb_id":"nm0000184","name":"George Lucas","place_of_birth":"Modesto - California - USA","popularity":2.185575,"profile_path":"/rJ1zvSeZfge0mHtLnzJn4Mkw18S.jpg"}<span class=""></span></td></tr></tbody></table></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 22, 2014 at 2:34 PM, Juan Christian <span dir="ltr"><<a href="mailto:juan0christian@gmail.com" target="_blank">juan0christian@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Testing code:</div><div><br></div>CODE ---------------------<div><br></div><div><div>#!/usr/bin/env</div><div><br></div><div>import requests</div><div>from blitzdb import Document, FileBackend</div><div><br></div><div><br></div><div>API_URL = '<a href="http://api.themoviedb.org/3" target="_blank">http://api.themoviedb.org/3</a>'</div><div>API_KEY = 'ddf3xxxxxxxx0289'</div><div><br></div><div><br></div><div>class Actor(Document):</div><div> pass</div><div><br></div><div><br></div><div>def get_actor(_id):</div><div> r = requests.get('{}/person/{}?api_key={}'.format(API_URL, str(_id), API_KEY))</div><div> return r.json()</div><div><br></div><div><br></div><div>actor_1 = Actor(get_actor(1))</div><div>actor_2 = Actor(get_actor(2))</div><div><br></div><div>backend = FileBackend("db.blitz")</div><div>actor_1.save(backend)</div><div>actor_2.save(backend)</div><div><br></div><div>print(backend.get(Actor,{'imdb_id' : 'nm0000184'}))</div><div>print('\n')</div><div>print(backend.get(Actor,{'imdb_id' : 'nm0000434'}))</div></div><div><br></div><div><br></div><div>OUTPUT ---------------------</div><div><br></div><div><div>Warning: cjson could not be imported, CJsonSerializer will not be available.</div><div>Traceback (most recent call last):</div><div> File ".\uff.py", line 27, in <module></div><div> print(backend.get(Actor,{'imdb_id' : 'nm0000184'}))</div><div> File "C:\Python34\lib\site-packages\blitzdb\backends\file\backend.py", line 456, in get</div><div> raise cls.DoesNotExist</div><div>blitzdb.document.DoesNotExist: DoesNotExist(Actor)</div></div><div><br></div><div><br></div><div>QUESTION ---------------------</div><div><br></div><div>Why the output says that Actor doesn't exists when I already added it here 'actor_1.save(backend)' and 'actor_2.save(backend)'</div></div>
</blockquote></div><br></div>