Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #79459
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <juan0christian@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.010 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'output': 0.05; 'subject:Python': 0.06; 'skip:" 60': 0.07; 'skip:f 70': 0.09; 'def': 0.12; 'cjson': 0.16; 'subject:issue': 0.16; 'backend': 0.19; 'import': 0.22; 'exists': 0.24; 'question': 0.24; 'pass': 0.26; 'code:': 0.26; 'testing': 0.29; 'skip:p 30': 0.29; 'raise': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'requests': 0.31; "skip:' 10": 0.31; 'skip:& 70': 0.31; 'file': 0.32; 'class': 0.32; 'says': 0.33; '(most': 0.33; 'skip:# 10': 0.33; 'skip:b 30': 0.33; 'could': 0.34; 'received:google.com': 0.35; 'url:org': 0.36; 'skip:- 20': 0.37; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'url:3': 0.61; 'here': 0.66 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=4jNi6rcAbqRlPnskTU1bqYuqNbri7Cug1XNylu4bTxw=; b=dc1qU0cROFyW1i6A9SX0fsFUkWglPm7kOA0WWd+gBDg0AI8H/6gadSY9RfPVhyDwGu 8rNi4kMa/N7hpQfyDxxkXG9TnXJ1bVFRK3Zoegn8K3vM4nOWTNGLXYzjJT1Fd/4eSiAz Fgxcb2E01hE/tJYn2tSh20jI0OuFS4SvSlkABqKatX7h6pTcotPenmjmo40URKb0unhV qbynZs5wiMzfuCr+hw/U/qd8tg0LrVwNKEqZZIa6P4DQlrzYTmSzfHcX6rt+CI1ikmXC RN/Kiw95TfSrHXXnutsa6K/S87lxYLoidcSu/GeiotljReF+Gl37xrhCc5uj3vmOktuu N9LA== |
| X-Received | by 10.152.216.167 with SMTP id or7mr3996877lac.93.1413995680633; Wed, 22 Oct 2014 09:34:40 -0700 (PDT) |
| MIME-Version | 1.0 |
| From | Juan Christian <juan0christian@gmail.com> |
| Date | Wed, 22 Oct 2014 14:34:20 -0200 |
| Subject | Python 3.4.1 and blitzdb issue |
| To | Python <python-list@python.org> |
| Content-Type | multipart/alternative; boundary=001a1135e3184216970506058662 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.15084.1413996099.18130.python-list@python.org> (permalink) |
| Lines | 90 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1413996099 news.xs4all.nl 2928 [2001:888:2000:d::a6]:60072 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:79459 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
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 <module>
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)'
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Python 3.4.1 and blitzdb issue Juan Christian <juan0christian@gmail.com> - 2014-10-22 14:34 -0200
csiph-web