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

2014-07-05 Thread Mike Bayer
On 7/3/14, 5:20 PM, trusted...@gmail.com wrote: Muchos grasias, Michael! Issue resolved. There were a couple of other ForeignKey issues, seems to be okay now. So far I understand that there is a lot to learn for me, so I was wondering - do you by chance accept apprentices ? I would be

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 Mike Bayer
On 7/3/14, 3:23 AM, trusted...@gmail.com wrote: 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

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 Mike 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 (default, Mar 7 2014, 19:17:16) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin Type help, copyright, credits or license for more information. import

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

2014-07-03 Thread Mike Bayer
this project needs: 1. a package 2. a setup.py file 3. a requirements.txt file I am running in each dependency indivdually as I get import errors. very painful. On 7/3/14, 1:19 PM, trusted...@gmail.com wrote: Mike, here is the source for the models:

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-03 Thread Mike Bayer
OK thats great but you have a long way to go: import cycle: classic$ .venv/bin/python Python 2.7.5 (default, Mar 7 2014, 19:17:16) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin Type help, copyright, credits or license for more information. import model Traceback (most recent

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,

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

2014-07-02 Thread Mike Bayer
On 7/2/14, 10:21 AM, trusted...@gmail.com wrote: 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 ? that would mean you're doing something that is

[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

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

2014-07-01 Thread Mike Bayer
On 7/1/14, 1:17 PM, trusted...@gmail.com wrote: 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