On Mon, 4 Mar 2019, Jonathan Vanasco wrote:

We "define" the model in a separate package - all the classes and
relationships are in there. There are database support items as well, and
some of the advanced/business logic that manipulate the ORM objects. By
advanced-database-specific logic, an example might be: resetting a
password is a function that checks the existing password against current &
past ones, updates the current credentials table, and migrates a consumed
credential into a table of invalid previously used options - it's a
multi-step database update.

Jonathan,

Thanks for clarifying.

For this and the next application I need to build the model (in model.py) is
the SQLAlchemy translation of the postgres tables; with this application
there are 9 tables/classes. No other application will use these.

The webapps typically have a "model" namespace, but that just invokes the
'shared' model package and contains any application/implementation
specific model logic. Everything is written so it can be easily migrated
into the shared model package so all of the coordinated apps/utilities can
leverage it.

I have a module called commonDlgs.py which contains re-useable classes, such
as password login, quitter (asks 'Are you sure?'), and generic message box.

This is just a personal preference my I have gravitated towards with my
team over the past few years.

You're really helped me resolve my questions. Now I know that I can put
classes in whatever modules and subdirectories I want as long as import them
where they are used, and it really doesn't matter what the structure is so
long as it is easy for others to follow. The current application is for my
business needs; the next one will be given away and hosted on github.

Regards,

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