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 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
>>>



tests dont run:

$ .venv/bin/nosetests -v
Failure: ImportError (No module named mail) ... ERROR
Failure: ImportError (No module named app) ... ERROR
Failure: ImportError (No module named app) ... ERROR

======================================================================
ERROR: Failure: ImportError (No module named mail)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/Users/classic/Desktop/tmp/artFlask/.venv/lib/python2.7/site-packages/nose/loader.py",
line 414, in loadTestsFromName
    addr.filename, addr.module)
  File
"/Users/classic/Desktop/tmp/artFlask/.venv/lib/python2.7/site-packages/nose/importer.py",
line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File
"/Users/classic/Desktop/tmp/artFlask/.venv/lib/python2.7/site-packages/nose/importer.py",
line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/Users/classic/Desktop/tmp/artFlask/app/__init__.py", line 6, in
<module>
    from mail import mail
ImportError: No module named mail

etc.

These are all very basic Python issues.  If you can get on IRC and get
someone to help you get your program just to import in a basic way you
can probably figure out why your models aren't initializing.    Good luck!









On 7/3/14, 3:29 PM, trusted...@gmail.com wrote:
> 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 (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, trust...@gmail.com <javascript:> wrote:
>>>     Mike, here is the source for the models:
>>>     https://github.com/ArtAPI/artFlask/blob/refactoring/model/__init__.py
>>>     <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, trust...@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 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 sqlalchemy+...@googlegroups.com <javascript:>.
>>>     To post to this group, send email to sqlal...@googlegroups.com
>>>     <javascript:>.
>>>     Visit this group at http://groups.google.com/group/sqlalchemy
>>>     <http://groups.google.com/group/sqlalchemy>.
>>>     For more options, visit https://groups.google.com/d/optout
>>>     <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 sqlalchemy+unsubscr...@googlegroups.com
> <mailto:sqlalchemy+unsubscr...@googlegroups.com>.
> To post to this group, send email to sqlalchemy@googlegroups.com
> <mailto:sqlalchemy@googlegroups.com>.
> 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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to