Hi Ross,
Thanks for your quick answer. I think I understand what you mean, ...
but not completely. Now I've used "class Post(db.DynamicDocument)" -
not "class Post(db.Dynamic Document)"- and without "body = ..."
sentence, but I have some warnings in Flask console and when editing
any of the Post I got an error: AttributeError: 'QuerySet' object has
no attribute 'get_or_404'
WARNINGS:
(venv) C:\Users\Miquel\python\miblog\tumblelog>python manage.py
runserver
C:\Users\Miquel\python\miblog\venv\lib\site-packages\mongoengine
\base.py:558: FutureWarning: BlogPost uses inheritance, the default
for allow_inheritance is hanging to off by default. Please add it to
the document meta.
FutureWarning
C:\Users\Miquel\python\miblog\venv\lib\site-packages\mongoengine
\base.py:558: FutureWarning: Video uses inheritance, the default for
allow_inheritance is hanging to off by default. Please add it to the
document meta.
FutureWarning
C:\Users\Miquel\python\miblog\venv\lib\site-packages\mongoengine
\base.py:558: FutureWarning: Image uses inheritance, the default for
allow_inheritance is hanging to off by default. Please add it to the
document meta.
FutureWarning
C:\Users\Miquel\python\miblog\venv\lib\site-packages\mongoengine
\base.py:558: FutureWarning: Quote uses inheritance, the default for
allow_inheritance is hanging to off by default. Please add it to the
document meta.
FutureWarning
* Running on
http://0.0.0.0:5000/
* Restarting with reloader
C:\Users\Miquel\python\miblog\venv\lib\site-packages\mongoengine
\base.py:558: FutureWarning: BlogPost uses inheritance, the default
for allow_inheritance is changing to off by default. Please add it to
the document meta.
FutureWarning
C:\Users\Miquel\python\miblog\venv\lib\site-packages\mongoengine
\base.py:558: FutureWarning: Video uses inheritance, the default for
allow_inheritance is changing to off by default. Please add it to the
document meta.
FutureWarning
C:\Users\Miquel\python\miblog\venv\lib\site-packages\mongoengine
\base.py:558: FutureWarning: Image uses inheritance, the default for
allow_inheritance is changing to off by default. Please add it to the
document meta.
FutureWarning
C:\Users\Miquel\python\miblog\venv\lib\site-packages\mongoengine
\base.py:558: FutureWarning: Quote uses inheritance, the default for
allow_inheritance is changing to off by default. Please add it to the
document meta.
FutureWarning
ERRORS:
127.0.0.1 - - [18/Jun/2012 23:52:32] "GET /admin/post-imatge/ HTTP/
1.1" 500 -
Traceback (most recent call last):
File "C:\Users\Miquel\python\miblog\venv\lib\site-packages\flask
\app.py", line 1518, in __call__ return self.wsgi_app(environ,
start_response)
File "C:\Users\Miquel\python\miblog\venv\lib\site-packages\flask
\app.py", line 1506, in wsgi_app response =
self.make_response(self.handle_exception(e))
File "C:\Users\Miquel\python\miblog\venv\lib\site-packages\flask
\app.py", line 1504, in wsgi_app response =
self.full_dispatch_request()
File "C:\Users\Miquel\python\miblog\venv\lib\site-packages\flask
\app.py", line 1264, in full_dispatch_request rv =
self.handle_user_exception(e)
File "C:\Users\Miquel\python\miblog\venv\lib\site-packages\flask
\app.py", line 1262, in full_dispatch_request rv =
self.dispatch_request()
File "C:\Users\Miquel\python\miblog\venv\lib\site-packages\flask
\app.py", line 1248, in dispatch_request return
self.view_functions[rule.endpoint](**req.view_args)
File "C:\Users\Miquel\python\miblog\tumblelog\auth.py", line 26, in
decorated return f(*args, **kwargs)
File "C:\Users\Miquel\python\miblog\venv\lib\site-packages\flask
\views.py", line 84, in view return self.dispatch_request(*args,
**kwargs)
File "C:\Users\Miquel\python\miblog\venv\lib\site-packages\flask
\views.py", line 151, in dispatch_request return meth(*args, **kwargs)
File "C:\Users\Miquel\python\miblog\tumblelog\admin.py", line 57, in
get context = self.get_context(slug)
File "C:\Users\Miquel\python\miblog\tumblelog\admin.py", line 35, in
get_context post = Post.objects.get_or_404(slug=slug)
AttributeError: 'QuerySet' object has no attribute 'get_or_404'
127.0.0.1 - - [18/Jun/2012 23:52:32] "GET /admin/post-imatge/?
__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [18/Jun/2012 23:52:32] "GET /admin/post-imatge/?
__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [18/Jun/2012 23:52:32] "GET /admin/post-imatge/?
__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [18/Jun/2012 23:52:32] "GET /admin/post-imatge/?
__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -
127.0.0.1 - - [18/Jun/2012 23:52:32] "GET /admin/post-imatge/?
__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [18/Jun/2012 23:52:32] "GET /admin/post-imatge/?
__debugger__=yes&cmd=resource&f=source.png HTTP/1.1" 200 -
Probably I'm doing something wrong, but I'm still not skilled enough
to find it out. I'm afraid I'll have to study the code in more
detail...
Regards,
Miquel