Re: [sqlalchemy] failed to locate a name error when using model with relationship

2014-07-03 Thread trustedbox
Hi, Michael, here is the stack trace: File /home/andrey/projects/art/artFlask/api/artList.py, line 30, in post item = app_ctx.create_item_from_context() File /home/andrey/projects/art/artFlask/utils/app_ctx.py, line 53, in create_item_from_context item = ModelClass(**data) File

Re: [sqlalchemy] failed to locate a name error when using model with relationship

2014-07-03 Thread trustedbox
Adding import instruction to artList.py didn't seem to help: from model import Artwork, Person What else can I do ? четверг, 3 июля 2014 г., 17:33:09 UTC+3 пользователь Michael Bayer написал: On 7/3/14, 3:23 AM, trust...@gmail.com javascript: wrote: Hi, Michael, here is the stack

Re: [sqlalchemy] failed to locate a name error when using model with relationship

2014-07-03 Thread trustedbox
Mike, here is the source for the models: https://github.com/ArtAPI/artFlask/blob/refactoring/model/__init__.py I would really apprieciate your feedback on this, I'm really new to flask and SQLAlchemy. The other source files (artList.py etc) are also there. Thank you, Andrey четверг, 3 июля

Re: [sqlalchemy] failed to locate a name error when using model with relationship

2014-07-03 Thread trustedbox
Hi Mike! I've updated requirements. Let me check if I didn't commit something. четверг, 3 июля 2014 г., 20:41:55 UTC+3 пользователь Michael Bayer написал: to start with, you have an import cycle. fix that first. classics-MacBook-Pro-2:artFlask classic$ .venv/bin/python Python 2.7.5

Re: [sqlalchemy] failed to locate a name error when using model with relationship

2014-07-02 Thread trustedbox
Hi Michael, thank you for the answer. Both classes are in the same file so I don't see how it could be possible that one class is used while other is not imported. Could you help me with that ? Andrey вторник, 1 июля 2014 г., 21:05:11 UTC+3 пользователь Michael Bayer написал: On 7/1/14,

[sqlalchemy] failed to locate a name error when using model with relationship

2014-07-01 Thread trustedbox
I have two classes, Artwork and Person. Artwork has a relationship to Person. However, when I try to use them, I get an error thrown: InvalidRequestError: When initializing mapper Mapper|Artwork|artwork, expression 'Person' failed to locate a name (name 'Person' is not defined). If this is