Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'output': 0.05; 'subject:Python': 0.06; 'skip:" 60': 0.07; 'cc:addr:python-list': 0.11; 'def': 0.12; 'andreas': 0.16; 'cjson': 0.16; 'subject:issue': 0.16; 'wrote:': 0.18; 'backend': 0.19; 'import': 0.22; 'cc:addr:python.org': 0.22; 'exists': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'pass': 0.26; 'code:': 0.26; 'header:In- Reply-To:1': 0.27; 'testing': 0.29; 'skip:p 30': 0.29; 'raise': 0.29; "doesn't": 0.30; 'url:mailman': 0.30; 'code': 0.31; 'requests': 0.31; "skip:' 10": 0.31; 'asap.': 0.31; 'file': 0.32; 'class': 0.32; 'says': 0.33; 'url:python': 0.33; '(most': 0.33; 'skip:# 10': 0.33; 'skip:b 30': 0.33; 'maybe': 0.34; 'could': 0.34; 'url:listinfo': 0.36; 'url:org': 0.36; 'skip:- 20': 0.37; 'project': 0.37; 'christian': 0.38; 'recent': 0.39; 'url:mail': 0.40; 'guy': 0.60; 'url:3': 0.61; 'from:charset:utf-8': 0.61; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'reply': 0.66; 'url:be': 0.68; '2014,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wirtel.be; s=default; t=1413996511; bh=MVKSEONqDXRyuiMgxGqDPL9OqEI/uJS7i5YOqlXn+XI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding; b=oLl3iTtVWKxLb0N4sqt8XemiVndJJl5CUA5yeBKIk9m3sLUv+kL7tiXwq2kmjAUn8 lZBZp6j+XJpLihV0XYGjm58ej3TQSore527XymW03VmiRWU7GFrTFHDiVmdeLF7sWH RQ78pDn1/Fl4Xa99BNLLaBf+62BLqfzCYkrR8eH5gsdwIgO4RIeM2ezLd33PF7OtRo Dn6J2jZjcEdupRXCeoYNbzeNreWbQx665GFOZKkZkXrgpVKqOPZ5r2LULeoh+qxNes PdfWQCccs+RCtXCZKVaskadAZ2NCPr+OWoC3uHbQHKhCg2Zo11Sutp7rQ7DRb5Ble9 548HkRi+WjeUA== From: "=?utf-8?q?St=C3=A9phane?= Wirtel" To: "Juan Christian" Subject: Re: Python 3.4.1 and blitzdb issue Date: Wed, 22 Oct 2014 18:45:55 +0200 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Mailer: MailMate (1.8r4576) Cc: Python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 66 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413996857 news.xs4all.nl 2965 [2001:888:2000:d::a6]:39921 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79460 Maybe ask on the project on github. Andreas is a good guy and will reply asap. On 22 Oct 2014, at 18:34, Juan Christian wrote: > Testing code: > > CODE --------------------- > > #!/usr/bin/env > > import requests > from blitzdb import Document, FileBackend > > > API_URL = 'http://api.themoviedb.org/3' > API_KEY = 'ddf3xxxxxxxx0289' > > > class Actor(Document): > pass > > > def get_actor(_id): > r = requests.get('{}/person/{}?api_key={}'.format(API_URL, str(_id), > API_KEY)) > return r.json() > > > actor_1 = Actor(get_actor(1)) > actor_2 = Actor(get_actor(2)) > > backend = FileBackend("db.blitz") > actor_1.save(backend) > actor_2.save(backend) > > print(backend.get(Actor,{'imdb_id' : 'nm0000184'})) > print('\n') > print(backend.get(Actor,{'imdb_id' : 'nm0000434'})) > > > OUTPUT --------------------- > > Warning: cjson could not be imported, CJsonSerializer will not be > available. > Traceback (most recent call last): > File ".\uff.py", line 27, in > print(backend.get(Actor,{'imdb_id' : 'nm0000184'})) > File "C:\Python34\lib\site-packages\blitzdb\backends\file\backend.py", > line 456, in get > raise cls.DoesNotExist > blitzdb.document.DoesNotExist: DoesNotExist(Actor) > > > QUESTION --------------------- > > Why the output says that Actor doesn't exists when I already added it > here > 'actor_1.save(backend)' and 'actor_2.save(backend)' > -- > https://mail.python.org/mailman/listinfo/python-list -- Stéphane Wirtel - http://wirtel.be - @matrixise