On Wed, 17 Apr 2019, Rich Shepard wrote:

What is the proper syntax to import models as m a in a view module, e.g.,
activities.py? The syntax, 'import model as m' fails because it is not in
the same subdirectory as the importing module.

Getting closer. Added a blank __init.py__ in the models/ subdirectory. Now
I'm looking for the proper syntax to import the relevant class within that
module.

import model.activities as a

is not working:
Traceback (most recent call last):
  File "activities_data_entry.py", line 1, in <module>
    import model.activities as a
ModuleNotFoundError: No module named 'model'

So more work on my part.

Rich

--
SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to