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 model
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "model/__init__.py", line 1, in <module>
from app import db
File "app/__init__.py", line 46, in <module>
import views
File "/Users/classic/Desktop/tmp/artFlask/views.py", line 4, in <module>
from api.artists import Artists
File "/Users/classic/Desktop/tmp/artFlask/api/artists.py", line 32, in
<module>
from utils.app_ctx import ApplicationContext
File "/Users/classic/Desktop/tmp/artFlask/utils/app_ctx.py", line 1,
in <module>
from model import Artwork
ImportError: cannot import name Artwork
well fix the package part first. then fix the import cycle.
On 7/3/14, 1:39 PM, Mike Bayer wrote:
> 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, [email protected] wrote:
>> 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 июля 2014 г., 17:33:09 UTC+3 пользователь Michael Bayer
>> написал:
>>
>>
>> On 7/3/14, 3:23 AM, [email protected] <javascript:> 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 create_item_from_context
>> > item = ModelClass(**data)
>> > File "<string>", line 2, in __init__
>>
>> this means on line 30 of your artList.py class, the "Person" class
>> hasn't been set up yet, or was set up and failed to do so and for
>> some
>> reason the error didn't get reported (such as if some unusual
>> system of
>> loading modules were present).
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "sqlalchemy" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to [email protected]
>> <mailto:[email protected]>.
>> To post to this group, send email to [email protected]
>> <mailto:[email protected]>.
>> Visit this group at http://groups.google.com/group/sqlalchemy.
>> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.